?
Solved

VC to SQL server 6.5

Posted on 1998-11-17
1
Medium Priority
?
230 Views
Last Modified: 2010-03-19
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);
if (m_pRecordSet->Open(CRecordset::forwardOnly,pszQueryValue))

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

0
Comment
Question by:sanjaychopra
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 7

Accepted Solution

by:
tchalkov earned 200 total points
ID: 1091873
As far as I know the odbc driver which comes with sql server 6.5 is completely multithreaded. your problem comes from sql server - 5 user limit is too low - every recordset you open starts a new user connection. You can see the number of user connections to sql server using nt performance monitor or by running sp_who. Try increasing the number of allowed user connections. This setting can be changed using Enterprise manager or sp_configure
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question