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 : Query not finding certain customersSearch Forum

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

 New Topic 
 
 Post Reply 
[1]  
 Query not finding certain customers 
 Author   Message 
  Ian 
  
 Group: Members 
 Posts: 8 
 Joined: 2007-02-08 
 Profile
 Posted : 2008-04-15 06:25:38
We have been using a visual basic program to sync our SQL database with Quickbooks and the program has worked fine for a number of years (apart from minor issues) but last week we started encountering a slew of problems with various queries not returning results when they should have.  Most of these have been worked around in one way or another but the most recent has me confounded.  When trying to pull up a customer by First and Last name, no results are being returned despite the customer being in QB.  We are using the following query:

SELECT * FROM Customer WHERE IsActive = 1 and FirstName = 'FirstName' and LastName = 'LastName'

I tried removing the customer from QB and then readded them (through the VB QODBC app, so as to make sure the Datasource was set up properly) and the customer was added fine but then immediately after trying to query them, no results were found.  I also tried using Contact, FullName and querying the entire Customer table sorted by date.  When querying the entire table, 10000 some odd results are returned but the customer just added isn't one of them.  Any ideas as to why this might be?  Thanks in advance. 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-04-15 18:22:40

Sounds like you need to rebuild the optimized table. To do this just add the VERIFY tag to your query like this:

SELECT * FROM Customer VERIFY WHERE IsActive = 1 and FirstName = 'FirstName' and LastName = 'LastName'

See: How do I setup the QODBC Optimizer? Where are the Optimizer options? for more information.
See also: MS SQL Server 2000 Linked Server issue using the QODBC optimizer 

 

  Top 
  Ian 
  
 Group: Members 
 Posts: 8 
 Joined: 2007-02-08 
 Profile
 Posted : 2008-04-24 05:18:34
This solution does work but unfortunately it causes the query to take considerably longer (since its rebuilding the table each time it is run).  I tried reloading the data from the QODBC Optimizer panel but I'm still running into issues.  Are there any other solutions that might not cause so a large delay?  We run this program multiple times a day on multiple customers so its become a hassle when it takes so long to run.  Thank you in advance. 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-04-24 09:25:37

Just use:

SELECT * FROM Customer CALLDIRECT WHERE IsActive = 1 and FirstName = 'FirstName' and LastName = 'LastName'

instead.You can also 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

Examples:

select * from InvoiceLine UNOPTIMIZED
select * from InvoiceLine NOSYNC
select * from InvoiceLine VERIFIED

For example, to read new (recent) InvoiceLines directly out of QuickBooks use:

select * from InvoiceLine UNOPTIMIZED WHERE Txndate > {d '2008-04-01'}

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to