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 : Perl DBI/Win32::ODBCSearch Forum

Forum Home > FlexODBC - ODBC Driver for DataFlex Embedded DBMS > FlexODBC SQL Support Forum

 New Topic 
 
 Post Reply 
[1]  
 Perl DBI/Win32::ODBC 
 Author   Message 
  Robert E. Singer 
  
 Group: Members 
 Posts: 5 
 Joined: 2007-02-16 
 Profile
 Posted : 2007-02-17 04:56:51

hi -

i have lots of experience with perl, dbi & sql.  ive installed and configured qodbc.  when i run sql statements, it takes quite a while and then returns no results.  i check return codes from all dbi or win32::odbc calls and everything looks ok.  just no data.  for the sake of testing, i when deliberately use a bad dsn, user id, password, table name, invalid fields, etc.  in all instances the drivers indicate errors.  so its safe to assume that the connection my connection is valid.

does anybody have any experience with perl, dbi or win32::odbc and qodbc?

thx - bob

 

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

To check that you are connecting to QODBC, run:

SELECT * from Host

as this return a one record response saying what version of QuickBooks you are working with and the driver revision details.

You may also need to turn off 2.1 ODBC Compatibily to support TABLE_CAT (in ODBC v3) instead of TABLE_QUALIFIER (in ODBC v2).

 

  Top 
  Robert E. Singer 
  
 Group: Members 
 Posts: 5 
 Joined: 2007-02-16 
 Profile
 Posted : 2007-02-23 03:59:39

i unchecked "run 2.1 odbc compatibility" and executed "select * from host".  this now appears to work correctly.

heres my trivial test program:

--------------

#!c:/perl/bin/Perl.exe

use DBI;
use strict;

my $dbh;
my $sth;
my $row;
my $array_ref;


$dbh = DBI -> connect ( "dbi:ODBC:QuickBooks Data", "Programming", "Engineering1", { PrintError => 1, RaiseError => 1 } )
 or die "connect failed:  $DBI::errstr\n";

DBI -> trace ( 1 );

$sth = $dbh -> prepare ( "SELECT LastName FROM Customer" )
 or die "prepare failed:  $DBI::errstr\n";

$sth -> execute ( )
 or die "execute failed:  $DBI::errstr\n";

$array_ref = $sth -> fetchall_arrayref ( );

foreach $row ( @$array_ref ) {
 print "--->row: @$row\n";
}

$sth -> finish ( );

$dbh -> disconnect ( )
 or die "disconnect failed:  $DBI::errstr\n";

exit;

-----------

when i execute it, the program times out after a minute, with no results.  trace(1) gives the following output:

    DBI 1.53-ithread default trace level set to 0x0/1 (pid 7340)
    <- prepare('SELECT LastName FROM Customer')= DBI::st=HASH(0x1a5af5c) at t.pl line 83
dbd_describe failed, dbd_st_execute #2...!
    <- execute= -1 at t.pl line 86
    <- fetchall_arrayref= [ ] row-1 at t.pl line 89
    <- finish= 1 at t.pl line 102
    <- disconnect= 1 at t.pl line 104
    <- DESTROY(DBI::st=HASH(1a5af50))= undef
    <- DESTROY(DBI::db=HASH(1a5ae30))= undef
    <- disconnect_all= '' at DBI.pm line 700
!   <- DESTROY(DBI::dr=HASH(19ce54c))= undef during global destruction

if i execute a trace (9) and "select * from customer" it executes an sql describe statement, which returns tons of information, with the dbd_describe error message at the end.

what should i look at next?

thx - bob

 

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

You should  [ Review QODBC Messeges ] for the actual QODBC errors reported. I assume that you have already confirmed that you are able to connect to QuickBooks in unattended mode using VB Demo. See: How do I setup QODBC to auto-login into QuickBooks and start it if it's not running? for more.

 

  Top 
  Robert E. Singer 
  
 Group: Members 
 Posts: 5 
 Joined: 2007-02-16 
 Profile
 Posted : 2007-02-24 03:36:02

hi -

vbdemo is working fine.  it turns out that i can access everything from perl that i can in vbdemo.

what i have isolated the problem down to is: 

i need access to certain lists such as employee names and customer names.  in quickbooks i do not have "employees" permission or "sales & accounts receivable" permission, yet quickbooks will display the list of employees or customers.  i cant view any more detail, or create transactions and for my purposes i dont need to.  when i issue an sql query on name fields only, the query comes back empty.  what sql statement can i issue that will generate the employee names and customer names lists?

im avoiding asking for increased access permission because i dont think i need it.  if quickbooks will display certain information with my current permissions, then i would like to access the same information from sql.  is this reasonable?  is this possible?

thx - bob

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-02-24 09:34:07
Try looking at: What is error: 3260 (“Insufficient permission level to perform this action”)?  

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to