OK. I just converted over a VC++ application (actually *added* MSSQL support to existing support of Access) a couple of months ago.
The two are amazingly compatable. You mostly have to change your provider and connection information. In additon, the TIMESTAMP fields work a bit differently.
Here is a VC++ code snippet:
The generation tools in Visual Studio are pretty good.
if (catalogue && catalogue [0])
{/* Doing SQL */
dbinit.AddProperty(DBPROP_INIT_CATALOG, catalogue);
if (db_user && db_user [0])
{
dbinit.AddProperty(DBPROP_AUTH_USERID, db_user);
if (db_pass && db_pass [0])
dbinit.AddProperty(DBPROP_AUTH_PASSWORD, db_pass);
sprintf (logon_string, "UID=%s;PWD=%s;", db_user, db_pass ? db_pass : "");
}
else
sprintf (logon_string, "Trusted_Connection=Yes;");
sprintf (provider_string,
"Description=Using SQL;DRIVER=SQL Server;"
"SERVER=%s;APP=Using;WSID=%s;DATABASE=%s;%s",
dbname, dbname, catalogue, logon_string,
(db_extra && db_extra [0]) ? ";" : "", db_extra ? db_extra : "");
dbinit.AddProperty(DBPROP_INIT_PROVIDERSTRING, provider_string);
SQL = 1;
string_delim = '\'';
}
else
{ /*Must be Access*/
dbinit.AddProperty(DBPROP_INIT_DATASOURCE, dbname);
if (!db_user || !db_user [0])
dbinit.AddProperty(DBPROP_AUTH_USERID, "Admin");
else
dbinit.AddProperty(DBPROP_AUTH_USERID, "db_user");
if (!db_pass || !db_pass [0])
dbinit.AddProperty(DBPROP_AUTH_PASSWORD, "");
else
dbinit.AddProperty(DBPROP_AUTH_PASSWORD, db_pass);
dbinit.AddProperty(DBPROP_AUTH_CACHE_AUTHINFO, true);
dbinit.AddProperty(DBPROP_AUTH_ENCRYPT_PASSWORD, false);
dbinit.AddProperty(DBPROP_AUTH_MASK_PASSWORD, false);
dbinit.AddProperty(DBPROP_INIT_MODE, (long)16);
if (!db_extra || !db_extra [0])
dbinit.AddProperty(DBPROP_INIT_PROVIDERSTRING, "");
else
dbinit.AddProperty(DBPROP_INIT_PROVIDERSTRING, db_extra);
string_delim = '"';
}