Home > Software engineering >  C through the ODBC connection to the MySQL database can be read, but add change will make a mistake,
C through the ODBC connection to the MySQL database can be read, but add change will make a mistake,

Time:10-02

Application to this error


CodePudding user response:

Why create ODBC ADO recordset object

CodePudding user response:

G_pRS global? Into a local variable, to release after use

CodePudding user response:

See what mistakes or add exception handling
 try 
{
//your ADO code
}
The catch (_com_error & amp; E)
{
Cstrings strMsg;
StrMsg. The Format (_T (" error description: % s \ n error message % s "),
(LPCTSTR) e.D escription (),
(LPCTSTR) e.E rrorMessage ());
AfxMessageBox (strMsg);
}

CodePudding user response:

To connect to the MySQL database using MySQL Connector/C is more convenient,
There is a ready-made:
http://www.allmai.net/? CTRL=detail& Method=note& Id=10 & amp; Typename=note

CodePudding user response:

MFC under the vc + + ADO access to connect the MySQL database to add delete modify database
  • Related