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 : 2 connectionsSearch Forum

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

 New Topic 
 
 Post Reply 
[1]  
 2 connections 
 Author   Message 
  Vlad 
  
 Group: Members 
 Posts: 32 
 Joined: 2007-09-25 
 Profile
 Posted : 2007-09-28 05:27:24

I'm going to read from and write to QuickBooks datafile from VB6 application.

So far I realized that QBSDK (QBFC) is not good enough to retrieve data I want. It doesn't allow to select only fields I need and to add criteria I want. But it is done pretty good with QBODBC. But I do not know how to enter new records into QuickBooks (I'm not talking about INSERT statement). QuickBooks and QBSDK use their internal stuff to create ListIDs and some other values for many fields. They also create some relations. For instance adding a new Customer from QBSDK doesn't require to do much work.

I came up to the idea to use 2 approaches to work with QB data - SDK to write to QB datafile and QODBC to read from it. Maybe that's a stupid idea.

But in order to work that way I need to have 2 connections - 1 for SDK, another one for QODBC stuff. Creation of each connection takes about 20  seconds on my local machine. 40 seconds together.

Is there any way to use one connection for both? It could decrease the time for connection.

Thank you

Vlad

 

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-09-28 08:36:19

Yes, just use QODBC!!! QODBC has a SQLite backend server with many additional indexes to what the QuickBooks SDK supports, so data can be retreived much faster than calling QuickBooks directly. Also QODBC supports batch inserts so you can add up to 500 transactions or inserts at the one time. For example:

BatchStart
sp_batchstart InvoiceLine

BatchInsert1
INSERT INTO "InvoiceLine" ("CustomerRefListID", "RefNumber",
"InvoiceLineItemRefListID", "InvoiceLineDesc", "InvoiceLineRate",
"InvoiceLineAmount", "InvoiceLineSalesTaxCodeRefListID", "FQSaveToCache")
VALUES ('AC0000-1197757899', 'Batch1', '250000-933272656', 'Bin Permit Renovations',
200.00000, 200.00, '20000-999022286', 0) 

.............................

BatchInsert500
INSERT INTO "InvoiceLine" ("CustomerRefListID", "RefNumber",
"InvoiceLineItemRefListID", "InvoiceLineDesc", "InvoiceLineRate",
"InvoiceLineAmount", "InvoiceLineSalesTaxCodeRefListID", "FQSaveToCache")
VALUES ('AC0000-1197757899', 'Batch2', '250000-933272656', 'Bin Permit Renovations',
200.00000, 200.00, '20000-999022286', 0) 

BatchUpdate
sp_batchupdate  InvoiceLine

And QODBC will commit all the inserts when the sp_batchupdate stored procedure is executed.

 

  Top 
  Vlad 
  
 Group: Members 
 Posts: 32 
 Joined: 2007-09-25 
 Profile
 Posted : 2007-09-28 11:34:47

Thank you very much.

I just was surprised when I executed Insert statement and saw that ListID was generated and inserted along with the values I provided. I did not expect it. I was thinking that in case of Insert I have to provide all values including ListID.

Where can I find all documentation for QODBC. I searched web site, documents installed with the driver and found nothing.

For instance you mentioned sp_batchstart and sp_batchupdate  stored procedures. Probably there are some others. Sintax for statements is different from SQL Server. How to execute the code you gave as an example from VB6 and from VB2005?

I would ask you to give the link to full documentation for QODBC. 

Thanks again

Vlad

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-09-29 06:42:10
Well, this forum is it. Programmers don't like writting documentation, so this forum self documents as we all try things. Just so you know, if you want to specify the Invoice number, you insert with a RefNumber value otherwise if no RefNumber is specified, QuickBooks will automatically assign the next Invoice Number for you.

For further information see:
How can I create multiple lines in the Invoice, Purchase, Journal and other tables? 
How do I create a new Customer, invoice them and mark the invoice as paid? 
How do I add a Inventory Item using QODBC? 
How do I insert data into ItemNonInventory? 
How do I insert data into ItemService?  

Note: QuickBooks Invoice Numbers are alpha-numeric, just make sure that if you use a alpha prefix, that you always end it with numbers.

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to