0

I am connecting to the MS Access server with the following code.

Dim cnn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=162.222.225.78;Database=CRM.mdb;Integrated Security=SSPI;User ID=corpopef;Password=********;")
Dim cmd As New OleDb.OleDbCommand
If Not cnn.State = ConnectionState.Open Then
cnn.Open()
End If
cmd.Connection = cnn
cmd.CommandText = "INSERT INTO Addressbook(srno) " & _
"VALUES('" & Me.TextBox1.Text & "')"
cmd.ExecuteNonQuery()

But it results in the following error: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done." Please suggest to me some methods to work around this problem.

Thanks in advance...!

18
  • The connection string seems problematic for an access database Commented Aug 2, 2014 at 7:06
  • can u plz help in connection string for access database in server.. Commented Aug 2, 2014 at 7:09
  • where is the MDB file located? Commented Aug 2, 2014 at 7:30
  • try this Dim cnn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=162.222.225.78\CRM.mdb;User ID=corpopef;Password=********;") Commented Aug 2, 2014 at 8:34
  • apart from that,insted of your connection method use this Using cn As New OleDbConnection(ConnectionString) ... End Using Commented Aug 2, 2014 at 8:38

1 Answer 1

1

The connection string you used seems like an SQL client connection string. For an access database, you should use this format:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=path_to_mdb_file\CRM.MDB;User Id=user_id; Password=password;

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.