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 : Delphi 7 cannot connect to QB7 enterprise using ADO??Search Forum

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

 New Topic 
 
 Post Reply 
[1]  
 Delphi 7 cannot connect to QB7 enterprise using ADO?? 
 Author   Message 
  iNDiGLo 
  
 Group: Members 
 Posts: 3 
 Joined: 2007-03-02 
 Profile
 Posted : 2007-03-02 06:27:20
I am running Delphi 7 Enterprise and trying to connect to QuickBooks Enterprise Solutions - Manufacturing and Wholesale Edition 7.0.

Since the version of Quickbooks i want to interface with includes a (read-only) version of the QODBC driver i tried connecting with it first and then tried installing the 30 day eval of QODBC v7.00.00.207 with the same results which follow.

I can successfully get the product installed and registered with Quickbooks. I can get the VB demo project to successfully connect using the DSN created. I can query tables and get results with no issues.

The problem can be recreated in the following manner:

1.) Launch Delphi 7 Enterprise and create a new project.
2.) Drop a TADOConnection,  TADOQuery, and a TButton on the form.
2.) Set the TADOConnection.ConnectionString property to: Provider=MSDASQL.1;Persist Security Info=False;Data Source=QuickBooks Data;Mode=Read
3.) With QuickBooks open in the background (logged into the company file) i change the 'Connected' property of the TADOConnection object to TRUE and it works (appears to be connected).
4.) Next set the TADOQuery.connection property to TADOConnection1.
5.) Open the TADOQuery.SQL property and type:  SELECT * FROM ITEM
6.) Change the TADOQuery.Active property to TRUE and it works (appears to be connected).
7.) Drop a TDataSource on the form and connect it to the TADOQuery. (works )

Heres where it errors....

8.) Drop a TDBGrid on the form and attempt to set its Datasource property to Datasource1 and you immediately get this error:

"Data provider or other service returned an E_FAIL status."

I thought maybe it was an issue with the TDBGrid so i deleted it from the form and dropped a TButton on the form and attached this in the buttons OnClick event:

ShowMessage(IntToStr(Query1.RecordCount)):

and got the same error.


a resolution would be greatly appreciated.  I have a few other issues regarding auto-login without the quickbooks gui being launched everytime too even though both Quickbooks and the qodbc drivers are configured correctly. However if i cannot get my main issue resolved the other issues wont matter.  I hope the resolution is a configuration oversight on my part.

Regards,

iNDiGLo 

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

The ConnectionString property should be: Provider=MSDASQL.1;Persist Security Info=False;Data Source=QuickBooks Data;OLE DB Services=-2; and make sure you are running QODBC v7.00.00.207 (check the QODBC Setup Screen "About" tab.)

Try looking at:  I am using Delphi and am getting some column not found errors on long field names. Why? also.

 

  Top 
  iNDiGLo 
  
 Group: Members 
 Posts: 3 
 Joined: 2007-03-02 
 Profile
 Posted : 2007-03-02 09:51:41
Tom,

I have already tried that as well and did not work.

Are there any sample applications or additional Delphi related examples available?

Is the TADO Vcl built into Delphi what i should be using?

iNDiGLo 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-03-02 10:21:27

Sorry, this isn't a Delphi support forum, but ODBC connection from Delphi is very similar to connecting using BDE from Delphi.  Here is an example of connecting using the Tquery component. This example will also display the results of a sql statement.

Drop a Tquery, a Tdatasource, and a Tdbgrid component on a Delphi form.

Set the following properties for the Tquery component:
1) DatabaseName:  Pick "QuickBooks Data" from the list the data source names.
2) SQL:  Input the sql statement to be executed.  For example: "select * from Item".
3) Active: Set to True to connect.  And supply no user name and password on connection.

Set the following properties for the Tdatasource component:
1) Data Set:  Set to the name of the Tquery component, or "query1" in this case.

Set the following properties for the TDBGrid component:
1) Data Source:  Set to the name of the Tdatasource component, or "data source1" in this case.

Now you can see the returned results from the select statement in the dbgrid area.

 

  Top 
  iNDiGLo 
  
 Group: Members 
 Posts: 3 
 Joined: 2007-03-02 
 Profile
 Posted : 2007-03-02 10:59:07
Tom,

I appreciate your assistance. Using the non-ADO example in your last post seems to be working.

I believe my initial confusion could be cleared up if you would provide a simple example in the QODBC User Manual geared to Delphi Developers.
I would have expected the ADO connectivity in Delphi would have been the default connection method based on my 15yrs of programming experience.

Regards,

iNDiGLo 

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

ADO or connecting QODBC isn't the issue here, as you appear to have both working. We do provide general info on ADO at: How do I use ADO and Visual Basic? and you're most welcome to post some examples for the benefit of other Delphi developers who follow you at a later stage.

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to