In message <02cb01be97e2$960278a0$1e60b0cc@stripped>, "Patrick Sherr
ill" writes:
>Could you provide a sample of your implementation?
Sure: (no guarantees...)
#include <sql.h>
#include <sqlext.h>
#include <odbcinst.h>
void createDSN(const char *database)
{
if (!SQLSetConfigMode(ODBC_SYSTEM_DSN))
throw GeneralException("Unable to set system dsn mode");
if (!SQLWriteDSNToIni(database, "MySQL"))
throw GeneralException(String("Unable to create DSN for ") + String(database));
if (!SQLWritePrivateProfileString(database,
"Description",
"Created by eJournal RMS installer",
"ODBC.INI"))
throw GeneralException("Unable to set description variable");
if (!SQLWritePrivateProfileString(database,
"Database",
database,
"ODBC.INI"))
throw GeneralException("Unable to set database variable");
if (!SQLWritePrivateProfileString(database,
"Server",
"localhost",
"ODBC.INI"))
throw GeneralException("Unable to set server variable");
if (!SQLWritePrivateProfileString(database,
"Flag",
"0",
"ODBC.INI"))
throw GeneralException("Unable to set flag variable");
}