views:

21

answers:

2
Dim NorthWindOledbConnection As String = "Provider=SQLOLEDB;DataSOurce=SARAN-PC\SQLEXPRESS;Integrated Security=ssp1;InitialCatalog=Sara"

Dim rs As New ADODB.Recordset()

rs.Open("select * from SecUserPassword", NorthWindOledbConnection, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockBatchOptimistic)

i tried to run this above code in visual studio 2008... it shows the following error........

"Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done"

Help me to proceed further.. thanks in advance

A: 

Firstly, don't use ADO in VB.NET. Use ADO.NET.

Other than that, create a proper Connection object instead of passing around a string.
And fix your connection string. It's SSPI, not SSP1. And it's Data Source, not DataSOurce. And it's Initial Catalog, not InitialCatalog.

GSerg
A: 

You are using a very very very old way to access a Database that has been used with Visual Basic 6 and older.

Check to use ADO.NET instead of old ADO. For example you can use this code that is "similar" to the code you are using (but is not the best way to access the data on VS2008)

OleDbConnection con= New OleDbConnection( **Your Connection String** )
con.Open()
Dim command As OleDbCommand = New OleDbCommand("select * from SecUserPassword", con)
sqlCommand .CommandType = CommandType.Text

Dim reader As OleDbDataReader = TheCommand.ExecuteReader()
While reader.Read()
    System.Console.Write(reader(** Your Table Field Name** ).ToString())
End While
con.Close()

To view how to create a correct connection String see the site http://www.connectionstrings.com/

If you want to access to an SQL Server database also you can use the SQLClient namespace instead the OleDb. For example System.Data.SqlClient.SqlConnection instead the OleDbConnection to provide better performance for SQL Server

Dubas