467,175 Members | 1,343 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,175 developers. It's quick & easy.

ADODB Command parameter error !

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
  • viewed: 2759
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jonathan Presnell via .NET 247 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.