marvelsoft
asked on
ADODB cn.Execute
Experts,
Please help me to correct this code.
Codes to insert new record.
========================== ========== ========== ========== ========== ========== =========
string oConn, StrSql;
ADODB.Connection cn = new ADODB.Connection();
oConn = "Driver={MySQL ODBC 3.51 Driver};Server=xxx.xxx.xxx .xxx;Port= 3306;Optio n=131072;S tmt=;Datab ase=databa se;Uid=ADM IN;Pwd=pwr d";
StrSql = "insert into names (code, name) values ('00001', 'This is a test.')";
cn.Open(oConn, null, null, 0);
cn.Execute(StrSql, ?, ?);
cn.Close();
========================== ========== ========== ========== ========== ========== =========
Thanks,
Please help me to correct this code.
Codes to insert new record.
==========================
string oConn, StrSql;
ADODB.Connection cn = new ADODB.Connection();
oConn = "Driver={MySQL ODBC 3.51 Driver};Server=xxx.xxx.xxx
StrSql = "insert into names (code, name) values ('00001', 'This is a test.')";
cn.Open(oConn, null, null, 0);
cn.Execute(StrSql, ?, ?);
cn.Close();
==========================
Thanks,
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It is just happens to that my old programs is written in VB6 w/ ADODB, but Im started converting it to VS2005.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
2) You must include System.Reflection.Missing for optional parameters:
System.Reflection.Missing missing = System.Reflection.Missing.
cn.Open(oConn, null, null, 0);
cn.Execute(StrSql, ref missing, ref missing);