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 : Visual FoxPro accessing QuickBooks via QODBCSearch Forum

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

 New Topic 
 
 Post Reply 
[1]  
 Visual FoxPro accessing QuickBooks via QODBC 
 Author   Message 
  JayP 
  
 Group: Members 
 Posts: 2 
 Joined: 2007-02-26 
 Profile
 Posted : 2007-02-26 10:45:20

Trying to do the SQL Select command - the fields in the where-clause cause VFP to pop up a window for me to identify a new database but I'm strictly trying to use the QuickBooks database that I've already made connection to.   If I don't use a where clause I can connect, select, and loop/browse on the data successfully.   So I think I just need help on the syntax of how to reference data fields from the QuickBooks file in the where-clause.  Here are the details.

So first I connect to the QuickBooks database...no problem

STORE SQLCONNECT('QBdatabase','account','pass') TO xyz

Now, if I just say "get all records from table InvoiceLinkedTxn" I have no problem - and can Scan through the records or review them through a browseable table.

"select * from InvoiceLinkedTxn"         works just fine

I can also order the records

"select * from InvoiceLinkedTxn ORDER BY Salesrepreffullname, Txndate"      works!

My problem is that when I want to do a "where clause" it is thinking that the fields I've referenced are from another VFP database and so VFP & Windows opens up a window for me to identify a VFP dbf file.  

"select * from InvoiceLinkedTxn where Salesrepreffullname = 'PS' ORDER BY Refnumber"

This will cause the "find the .dbf file" window to open up.  

I'm guessing that I have to more fully qualify Salesrepreffullname in the where-clause ....something like xyz.Salesrepreffullname or m.xyz.Salesrepreffullname or InvoiceLInked.Salesrepreffullname so that it knows the where clause fields apply to the QuickBooks database as it does for the mentioned Order By fields.

Any advice?

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-02-26 12:36:52

This isn't a Visual FoxPro support forum. The SQL Statement:

select * from InvoiceLinkedTxn where Salesrepreffullname = 'PS' ORDER BY Refnumber

is a valid QODBC request. Try doing:

* Connect to an ODBC data source
LOCAL nHnd
nHnd = SQLCONNECT ("QuickBooks Data")

* Retrieve data from the remote server and stores it in
* a local data cursor
nResult = SQLEXEC (nHnd, "select * from InvoiceLinkedTxn where Salesrepreffullname = 'PS' ORDER BY Refnumber", "QINVOICETXN")

* Close the connection
SQLDISCONNECT(nHnd)

 

 

 

  Top 
  JayP 
  
 Group: Members 
 Posts: 2 
 Joined: 2007-02-26 
 Profile
 Posted : 2007-02-27 01:42:55

Tom, your suggestion worked.  Thank you!  I appreciate it.

Now regarding your first comment "This isn't a Visual FoxPro support forum."  My assigned tech support representative at QuickBooks who works in the ODBC tech support division who I sent my post to first.....directed me to submit my question to your forum and said that replies would be fast and friendly.

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to