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(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Dim RowsAffected As Integer
Dim AConnect As String = _
"Provider=Micro soft.Jet.OLEDB. 4.0;" & _
"Data Source=C:\ABC.m db;"
Dim AccessConnectio n As New OleDbConnection (AConnect)
Dim AccessCommand As New OleDbCommand
AccessCommand.C ommandText = "usp_Append_tbl _RefNos"
AccessCommand.C ommandType = CommandType.Sto redProcedure
AccessCommand.C onnection = AccessConnectio n
'Dim AccessDataAdapt er As New OleDbDataAdapte r(AccessCommand )
AccessConnectio n.Open()
RowsAffected = AccessCommand.E xecuteNonQuery( )
AccessConnectio n.Close()
AccessConnectio n = Nothing
AccessCommand.D ispose()
AccessCommand = Nothing
End Sub
TIA,
Jim