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