Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use ADO to add a new record into MySQL?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi Everybody,

I try to use MS-ADO to add a new reocrd to MySQL with Visual Basic and ODBC connection. The form is created by use Data Form Wizard. When I finished input text and Press Update buttom, it said: [TCX][MyODBC]Unknown column 'Category' in 'field list' (For Integer Field) and
[TCX][MyODBC]Table 'Tempdb.Make' doesn't exist (For String Field)
Tempdb is my database, Parts is table's name and both Category and Make are field name.

If I try to use MS-DAO, there is no problem.

Could anybody help me to give me solution?

Thanks

Fred

Email:wu808@yahoo.com
 
I knwo how it is from C++. Using ADO with ATL.
int main(int argc, char* argv[])
{
char* x = "xxxxxxxxx";
return 0;
CoInitialize(0);
{
CComPtr<_Connection> pConn;
CComPtr<IUnknown> pUnk;
HRESULT hr=pConn.CoCreateInstance(L&quot;ADODB.Connection&quot;,0,CLSCTX_INPROC_SERVER);
if(FAILED(hr))
{
cout<<&quot;failed&quot;<<endl;
}
hr=pConn->Open(
SysAllocString
(
L&quot;driver = {MySQL}database = {db_name});
),SysAllocString(L&quot;sa&quot;),SysAllocString(L&quot;cereus&quot;),0);
if(FAILED(hr))
{
cout<<&quot;failed&quot;<<endl;
}
hr=pConn->Execute(SysAllocString(L&quot;create table xxwwkkw(a integer)&quot;),0,0,0);
if(FAILED(hr))
{
cout<<&quot;failed&quot;<<endl;
}
}
CoUninitialize();
return 0;
} Ion Filipski
1c.bmp


filipski@excite.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top