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 SQL server OLE DB errorSearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC v7 Forum

 New Topic 
 
 Post Reply 
[1]  
 Linked SQL server OLE DB error 
 Author   Message 
  max_ayn 
  
 Group: Members 
 Posts: 3 
 Joined: 2006-04-28 
 Profile
 Posted : 2007-09-25 03:45:10

Hello. I'm experiencing a bit of a problem with the QODBC Server Edition..
Under SQL Manager I have a "Linked Server". The setup worked fine and I'm able to pull records from our QB data file via that SQL Linked Server. However, when I run a query against QB and re-run the same query in couple of seconds, it gives me an error "OLE DB provider 'MSDASQL' reported an error" and stops working for couple of minutes, when I re-run the query after about two minutes - it works fine again. What does it mean? I suspect that there is a pooling issue, but I'm not sure how I can prevent connection pooling in my environment. Here is my complete setup: a JSP based app is getting records from the Linked Server(pointing to the QB data file, using QODBC Server Edition with DCOM enabled) via JDBC. Maybe too complicated but it's working except that issue with the same query re-run. Please help. Thanks!

 

 

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-09-25 10:18:12
How does running the same query one after each other directly within the SQL Server Management Studio go? Why doesn't your JSP based app not talk directly to QODBC? 

  Top 
  max_ayn 
  
 Group: Members 
 Posts: 3 
 Joined: 2006-04-28 
 Profile
 Posted : 2007-09-25 12:03:48

Thanks for your quick reply Tom.

Within the MS SQL Query tool - exactly the same error. Knowing that native environment of MS SQL is throwing the same error I can skip the JSP check at this point.

I'll try to explain why I'm not using the direct connection from JSP to QODBC. As far as I know I need to setup a DSN to make a direct connection. The Java server is running on a separate Linux box and I'm not sure if I can setup a DSN from there to the Windows Server, hosting the QB data file and QODBC. Also, my JDBC driver doesn't support DSN calls(at least to my knowlledge), but can easily handle SQL connections.

 

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-09-25 15:36:05

Using the optimizer with MS SQL Server can be trickly depending on how MS SQL Server is setup in regards to using authenticated users. The actual connection to QuickBooks normally uses the Windows admin account, but when logged into a Windows user account this gets to be the account logged in. Therefore you should always use the Windows primary "Administrator" admin account to log into the server and use QODBC.

A linked server runs queries as muliple treads, and the QODBC optimizer is single user only. So you need to setup a different optimizer file for the SQL Server to use than the other disktops applications. To do this step up a seperate System DSN (see: How do I create or configure a QODBC DSN? ) and specify a fixed location of the optimizer database folder for SQL Server to use instead of the default %UserProfile% method.

 

  Top 
  max_ayn 
  
 Group: Members 
 Posts: 3 
 Joined: 2006-04-28 
 Profile
 Posted : 2007-09-26 02:38:03
The problem is gone with QODBC v.8 upgrade. Good job on v.8 guys! Thanks for your help Tom! 

  Top 
  William Astarita 
  
 Group: Members 
 Posts: 14 
 Joined: 2006-09-18 
 Profile
 Posted : 2007-11-14 04:32:48
I'm getting this error, I'm running SQL Server 2005, Win Server 2003, The latest 8.0 build of QODBC and Enterprise 6.0.  I created a new DSN, gave it it's own folder for the Optimizer that is not linked to a user account, ran a successful sync.  I get this error when I run this query:

SELECT * FROM OPENQUERY(DAMS, 'SELECT * FROM Accounts NOSYNC') {Dams being the name of my linked server}

OLE DB provider "MSDASQL" for linked server "DAMS" returned message "[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed".
OLE DB provider "MSDASQL" for linked server "DAMS" returned message "[QODBC] QB Begin Session Failed. Error = 80040416, If QuickBooks is not running, a call to the "BeginSession" method must include the name of the QuickBooks company data file.
".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "DAMS".

Quickbooks is definately running and the driver can update from it successfully, its all running on the same server.

I have never gotten a query to run properly, I have tried many methods.

Thanks in advance 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-11-14 08:30:18

Does:

SELECT * FROM OPENQUERY(DAMS, 'SELECT * FROM Accounts')

work?

The DSN needs to state the full path to your company file.

 

  Top 
  William Astarita 
  
 Group: Members 
 Posts: 14 
 Joined: 2006-09-18 
 Profile
 Posted : 2007-11-14 08:50:39
I made the changes you suggested and now I do not get any errors, SQL server returns a table with the proper headers but no data.  The same queries run as a passthrough from MS Access run with no problems

SELECT * FROM OPENQUERY(DAMS, 'SELECT * FROM Account')

SELECT * FROM OPENQUERY(DAMS, 'SELECT * FROM Account NOSYNC')
Both return proper headers but no data. 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-11-14 09:14:24

Ok, you need to repair the optimized file for your MS SQL Server linked table. Try running this to repair the optimized table first:

SELECT * FROM OPENQUERY(DAMS, 'SELECT * FROM Account VERIFY where ListID="x"')

As you can override your QODBC Optimizer configuration screen settings to suit what you are actually doing by using the following tags:

VERIFIED | VERIFY - Forces Full Resync with QuickBooks on the optimized table before Query starts
CALLDIRECT | UNOPTIMIZED - Passthru query directly to QuickBooks - use no optimizations
OPTIMIZE | OPTIMIZED | NOSYNC - Passthru query to optimized table directly for maximum speed


 

  Top 
  William Astarita 
  
 Group: Members 
 Posts: 14 
 Joined: 2006-09-18 
 Profile
 Posted : 2007-11-15 02:33:20
I tried several variations of the SQL syntax but get the same error each time.

OLE DB provider "MSDASQL" for linked server "DAMS" returned message "[QODBC] Column not found: x".
Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query "SELECT * FROM Account VERIFY where ListID="x"" for execution against OLE DB provider "MSDASQL" for linked server "DAMS".

Again, works perfectly in MS Access 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-11-15 09:27:52

The query itself is:

SELECT * FROM Account VERIFY where ListID='x'

with single quotes. When using MS SQL Server the single quote is replaced by double quotes within a single quote for the whole select statement:

SELECT * FROM OPENQUERY(DAMS, ' SELECT * FROM Account VERIFY where ListID= "x" ' )

so it depends how and from where you are executing the query.

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to