Hi Everybody,
I run a program that connects to a database like this:
dB.setHostName("localhost");
dB.setDatabaseName("DRIVER={Microsoft Access Driver (*.mdb)};FIL={MS Access};DSN='';DBQ=C:/Program Files (x86)/myFolder/myAccesApp.mdb;");
QSqlDatabase dB = QSqlDatabase::addDatabase("QODBC");
dB.setHostName("localhost");
dB.setDatabaseName("DRIVER={Microsoft Access Driver (*.mdb)};FIL={MS Access};DSN='';DBQ=C:/Program Files (x86)/myFolder/myAccesApp.mdb;");
To copy to clipboard, switch view to plain text mode
This obviously refers to an *mdb-file on localhost. Now: I'd like to connect directly to the database and not go through the mdb-file. Here's a snippet off the regEdit:
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\SomeName]
"Driver"="%systemroot%\\System32\\SQLSRV32.DLL"
"Description"="SomeDescription"
"Server"="MYHOSTNAME"
"LastUser"="me"
"Trusted_Connection"="Yes"
"Database"="NameOfDatabase"
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\SomeName]
"Driver"="%systemroot%\\System32\\SQLSRV32.DLL"
"Description"="SomeDescription"
"Server"="MYHOSTNAME"
"LastUser"="me"
"Trusted_Connection"="Yes"
"Database"="NameOfDatabase"
To copy to clipboard, switch view to plain text mode
How (if) would I form a sufficient string for the setDatabaseName() - methode?
Or am I completely wrong and without *mdb there is no way?
My basic problem is, that if I run more than one instance of the program (all looking at the same database of course), the database goes nuts and writes completely irrelevant crap into the tables using the sql - "update" - command.
Perhaps there is another major blindspot on my side?
Every help highly appreciated.
Regards, Lars
Bookmarks