J
Jim
I'm a vb.net newbie.
I have an query that is entirely within an Access database. It's a
simple update query - "usp_Append_tbl_RefNos". It works in Access,
How can I run that query from a vb .net program? I have an vb app that
does update another Access table using a stored procedure but it updates
fields with info from a file.
I've tried the code below and I get an error on the ExecuteNonQuery() -
"ODBC - connection to 'XYZ' failed". But I never reference "XYZ" server
anywhere in my program.
==================================================================
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim RowsAffected As Integer
Dim AConnect As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\ABC.mdb;"
Dim AccessConnection As New OleDbConnection(AConnect)
Dim AccessCommand As New OleDbCommand
AccessCommand.CommandText = "usp_Append_tbl_RefNos"
AccessCommand.CommandType = CommandType.StoredProcedure
AccessCommand.Connection = AccessConnection
'Dim AccessDataAdapter As New OleDbDataAdapter(AccessCommand)
AccessConnection.Open()
RowsAffected = AccessCommand.ExecuteNonQuery()
AccessConnection.Close()
AccessConnection = Nothing
AccessCommand.Dispose()
AccessCommand = Nothing
End Sub
TIA,
Jim
I have an query that is entirely within an Access database. It's a
simple update query - "usp_Append_tbl_RefNos". It works in Access,
How can I run that query from a vb .net program? I have an vb app that
does update another Access table using a stored procedure but it updates
fields with info from a file.
I've tried the code below and I get an error on the ExecuteNonQuery() -
"ODBC - connection to 'XYZ' failed". But I never reference "XYZ" server
anywhere in my program.
==================================================================
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim RowsAffected As Integer
Dim AConnect As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\ABC.mdb;"
Dim AccessConnection As New OleDbConnection(AConnect)
Dim AccessCommand As New OleDbCommand
AccessCommand.CommandText = "usp_Append_tbl_RefNos"
AccessCommand.CommandType = CommandType.StoredProcedure
AccessCommand.Connection = AccessConnection
'Dim AccessDataAdapter As New OleDbDataAdapter(AccessCommand)
AccessConnection.Open()
RowsAffected = AccessCommand.ExecuteNonQuery()
AccessConnection.Close()
AccessConnection = Nothing
AccessCommand.Dispose()
AccessCommand = Nothing
End Sub
TIA,
Jim