The video shows how to connect to the MySQL database. It is troublesome to configure MySQL after installation. Therefore, I tried to connect to the Access database using the template provided by the instructor. Access is more convenient to use.
Almost all of them are installed with office.
First, search for odbc connection strings in Baidu to find asp connection Access method, but ODBC is common, so it can also be used directly.
Set
SQLCHAR ConnStrIn [MAXBUFLEN] = "DRIVER = {MySQL ODBC 5.1 Driver}; SERVER = 127.0.0.1; UID = root; PWD = root; DATABASE = test; CharSet = gbk ;";
Partially changed
SQLCHAR ConnStrIn [MAXBUFLEN] = "Driver = {Microsoft Access Driver (*. mdb)}; Dbq = // mydatabase. mdb; Uid = Admin; Pwd =; CharSet = gbk ;";
Dbq refers to the path strength of your database
Of course, you should create a database named mydatabase. mdb in c:/, and if the following SQL statement is written by the instructor
Result = SQLPrepare (hstmt, (SQLCHAR *) "insert into T_Person (FAge, FName) values (20, 'kiider ')", SQL _nt); www.2cto.com
In this case, you must create a T_Person table and two fields FAge and FName In the table. Otherwise, an error will occur.