T O P I C R E V I E W |
jguenrdc |
Posted - 06/05/2006 : 4:41:33 PM Origin Version: OriginPro 7.5 SR6 v7.5885(B885) Operating System: Windows XP Pro SP2
I would like to work with an ADO Connection object and an ADO Command object. I have the following code:
static Object occnxn; static Object occmd; BOOL testCXN() { string strConn; occnxn = CreateObject("ADODB.Connection"); if( !occnxn ) return FALSE; strConn = "Provider=SQLOLEDB; Server=jayg; Database=flocis; User ID=jay; WSID=JAYG; Trusted_Connection=Yes"; occnxn.open(strConn); occmd = CreateObject("ADODB.Command"); if( !occmd ) return FALSE; occmd.ActiveConnection = occnxn; // ERROR HERE /* more code later */ occnxn.Close(); return TRUE; }
The line marked "// ERROR HERE" gives me this compile error: Error, Incompatible variable types in expression
Microsoft's docs say the ActiveConnection property is expecting a variant. I am confused by their Visual C++ code example, however. Can anyone help me figure out how to make the ActiveConnection property assignment?
Jay |
2 L A T E S T R E P L I E S (Newest First) |
jguenrdc |
Posted - 06/06/2006 : 4:10:22 PM I was able to find a workaround by using the Execute method of the ADO Connection object:
occnxn = CreateObject("ADODB.Connection"); if( !occnxn ) return FALSE; strConn = "Provider=SQLOLEDB; Server=jayg; Database=flocis; User ID=jay; WSID=JAYG; Trusted_Connection=Yes"; occnxn.open(strConn); occnxn.Execute("spChangePipeSize @HeaderID=1,@NewSize='20'",NULL,0x88); occnxn.Close();
[not sure why the underline is there - j]
Jay
Edited by - jguenrdc on 06/06/2006 4:12:19 PM |
ML |
Posted - 06/06/2006 : 11:26:14 AM Hi Jay,
The assignment you are trying is not possible in 7.5. I can't think of a workaround.
ML |
|
|