By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,454 Members | 3,103 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,454 IT Pros & Developers. It's quick & easy.

ADODB Command parameter error !

P: n/a
Hi all !

I've created a .net serviced component with only one method. This method
receive an ADODB.Command object and execute it.
The ADODB.Command object is created in the client process. (VB for example).

When I try to set the connection property or try to open a recordset using
the Command object I've got an error.

Here is the mehotd code for the connection set error:

public ADODB.Recordset ExecuteCommand(ADODB.Command cmd)
{

ADODB.Recordset rst = new RecordsetClass();

cmd.ActiveConnection = cnn; <------------ Argument invalid error here !
cnn is an ADODB.Connection already created and opened !

rst.CursorLocation = CursorLocationEnum.adUseClient;

object o = System.Reflection.Missing.Value;

rst.Open(cmdnew, o, ADODB.CursorTypeEnum.adOpenStatic,
ADODB.LockTypeEnum.adLockReadOnly, -1);

return rst;

}

Here is the mehotd code for the "OLE IDispatch Provider: no such interface
supported" error:

public ADODB.Recordset ExecuteCommand(ADODB.Command cmd)
{

ADODB.Recordset rst = new RecordsetClass();

rst.CursorLocation = CursorLocationEnum.adUseClient;

//---- the following line produces that error. If I change the cmdnew
Command object with a select string ("select * from ...), works fine !
rst.Open(cmdnew, cnn, ADODB.CursorTypeEnum.adOpenStatic,
ADODB.LockTypeEnum.adLockReadOnly, -1);

return rst;

}

Any Ideas ? Any comment or tip will be apreciated !

TIA,

--
Andre Azevedo


Nov 15 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.