Method 1: Unlock when creating a data source:
You can create a data source manually (under the control panel) orCodeCreate (seeDynamic Data Source Creation
).
However, if you want to unlock the data source while creating the data source, you can only manually:
After entering the data source name, click "advanced", and then enter the login name and password (that is, the Access Database Password.
Method 2: Unlock when binding a record set category:
After the record set class is bound as usual (set the record set class to cxxset, the Database Password to 123, and the login name to any, for example, God): Open xxset. CPP file, add the yellow part in cxxset: getdefaconnect connect:
Cstring cxxset: getdefaconnect connect ()
{
Return _ T ("ODBC; DSN = bookmanage; Uid = God; Pwd = 123.
");
}
In this way, the record set cxxset can access the database smoothly.