'System.Runtime.InteropServices.COMException' occurred in microsof

G

Guest

HEllo,

I'm trying to write my first application in VB.NET (I'm not developper) and
when I do:

oCommand.CommandText = StrQuery(i)
oCommand.Properties("Page Size") = 1000
oCommand.Properties("Timeout") = 30
oCommand.Properties("Searchscope") = 2
oCommand.Properties("Cache Results") = False

'Execute the query
oRecordSet = oCommand.Execute

I have an error on the last line:

An unhandled exception of type 'System.Runtime.InteropServices.COMException'
occurred in microsoft.visualbasic.dll

Additional information: Unspecified error

StrQuery(i) is declared as string.

An idea ?
 
T

The Grim Reaper

You'll need to post more code and/or explain what references/libraries
you're using for Recordset object and Command objects.
__________________________________
The Grim Reaper
 
G

Guest

OK

I 'm using the following code:

oCommand = CreateObject("ADODB.Command")
oConnection = CreateObject("ADODB.Connection")
'oRecordSet = CreateObject("ADODB.Recordset")
'oConnection = ADODB.Connection
oConnection.Provider = "ADsDSOObject"
oConnection.Open("Active Directory Provider")
oCommand.ActiveConnection = oConnection

oCommand.CommandText = StrQuery(i)
oCommand.Properties("Page Size") = 1000
oCommand.Properties("Timeout") = 30
oCommand.Properties("Searchscope") = 2
oCommand.Properties("Cache Results") = False

'Execute the query

oRecordSet = oCommand.Execute

Need you more ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top