Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection to ADsDSOObject

Status
Not open for further replies.

aTekTipsUser

Programmer
Nov 8, 2004
68
US
Has something changed with the connection to the ADsDSOObject in vb.net? The following worked in vb 6, but when I convert it to vb.net I get the error 'No error information available: DB_E_Notable(0x80040E37)'. The connection opens, but the ExecuteReader fails. The sql is the exact same as the sql that worked in vb6.

aCon.ConnectionString = "Provider=ADsDSOObject;User ID="""";password="""""

aCon.Open

aCommand.Connection=aCon

aCommand.CommandText="Select fields FROM 'LDAP://DC=Domain,DC=Server"

'This is where it errors
dataReader=aCom.ExecuteReader()

 
I figured out what the difference is. I vb6 I set the ConnectionString to:
aCon.ConnectionString = "Provider=ADsDSOObject;User ID="""";password="""""

In vb.net, it opens the connection, but I cannot execute any queries. When I changed the Connection string to:
aCon.ConnectionString = "Provider=ADsDSOObject"
it worked.
 
If you Imports System.Data.OleDb and use an OleDbConnection you can then set the .Provider property directly, which will accomplish the same thing you did.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top