Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : Linked Servers, Stored Procedures and .NetSearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC SQL Support Forum

 New Topic 
 
 Post Reply 
[1]  
 Linked Servers, Stored Procedures and .Net 
 Author   Message 
  Al 
  
 Group: Members 
 Posts: 1 
 Joined: 2008-07-04 
 Profile
 Posted : 2008-07-04 16:07:21

I just wanted to pass on recent experience I gained whilst developing a .Net application that used QODBC as I think this will help other people.

Basically my application used simple ADO.NET commands to populate a DataAdapter using a Stored Procedure. The Stored Proc was held in a SQL Database and utilised a Linked Server to get to the QODBC data source. I didn't think I was asking the system to do anything complicated but when I began to debug my application I was getting the following error when populating my dataset;

Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "QODBC".

I tested my Stored Proc from within SQL Management Studio and it was returning the expected response without a problem. So, what was causing the error? I trawled through the forum to find answers, checked all my QODBC settings and then noticed one minor difference between my Stored proc call in my .Net application and using SQL Management Studio - the security context.

In my .Net application, I had been opening my database connection as a different user to the one for SQL Management Studio. When I created a new connection in SQL Management Studio using the same credentials as my .Net application and ran the Stored Proc again, I got the same error. This time it also gave me a few more pointers to the problem;

OLE DB provider "MSDASQL" for linked server "QODBC" returned message "[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed".
OLE DB provider "MSDASQL" for linked server "QODBC" returned message "[QODBC] QB Begin Session Failed. Error = 80040421, The specified user is already logged in on another machine.

My QODBC connection was created originally when I was doing my testing through SQL Management Studio. When I tried to get my .Net application to connect to the same QODBC data source using a different set of credetials, it was returning the error. So, I killed the qbw32.exe process, re-ran my .Net application and got a successful result - my dataset was successfully populated.

I hope this helps other QODBC users.

Al

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-07-04 18:26:51
Yes, you do need to check what system account is used by any Windows Service and what user account is used by any application. In some cases you might even have to grant permissions to individual AUTHENTICATED USERS as group rights can fail. Thanks for your comments. 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to