We have a multithreaded application (developed using VC/MFC) running on an NT machine.
The various threads need to do DB access, hence there is a potential that DB access may occur simultaneously from various threads.
Now this application runs perfectly well when we have MS-Access as the database (of course with appropriate ODBC driver loaded), but when we try to use SQL server, the application just doesn't work.
I believ the ODBC makes it possible to plug and play.Any body any guesses as to if there is anything special thet needs to be done when one is migrating from MS-Access to SQL server apart from the ODBC conf.settings.
Just to give further insight to the VC experts:
We have opened the database as :
m_pDatabase = new CDatabase;
if (m_pDatabase-> Open(NULL,FALSE, FALSE,"ODBC;DSN=TESTDB;",TRUE))
We open the database only once when the application starts, thereafter this global handle is used across the threads.
But we open and close the recordset as when we need any data from any of the tables.Data fetched is always using SELECT statement, and we don't do any updates through this application.
The recordset is opened as :
m_pRecordSet = new CRecordset(m_pDatabase);
where pszQueryValue contains the SQL SELECT statement.
NB: I doubt there is problem becuase our application is multithreaded and SQL server is just not able to handle the simultaneous requests or there is a limit or something ...AMMM CONFUSED...HELP!!!
We have a 5 user copy of SQL server