#!/usr/bin/perl use Data::Dumper; use IO::File; use XML::LibXML; use XML::LibXSLT; use Win32::OLE::Const; Win32::OLE->Option(Warn => 2); use strict; my $appname='Test App'; my $qbfile=''; main(); sub main { my $const = Win32::OLE::Const->Load("QBXMLRP2 1.0 Type Library"); my $session = Win32::OLE->new("QBFC10.QBSessionManager", sub {$_[0] +->CloseConnection();}) or die "oops\n"; $session->OpenConnection2("", $appname, $const->{"localQBD"}); my $ticket = $session->BeginSession($qbfile, $const->{"qbFileOpenDoN +otCare"}); my $msgSet = $session->CreateMsgSetRequest('US',3,0); $msgSet->AppendVendorQueryRq; my $resSet = $session->DoRequests($msgSet); my $resList = $resSet->ResponseList; my $count = $resList->Count; for (my $i=0; $i < $count; ++$i) { warn $i; my $res = $resList->GetAt($i); my $vendList = $res->Detail; warn Dumper($vendList); my $vcount = $vendList->Count; for (my $j=0; $j < $vcount; ++$j) { my $vend = $vendList->GetAt($j); my $dname = $vend->Name; my $name = $dname->GetValue; warn "Vendor name: $name"; } } $session->EndSession; $session->CloseConnection; warn "Goodbye World!"; }
-- Terence Parr, "Enforcing Strict Model View Separation in Template Engines"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
version using qbXML
by metaperl (Curate) on Jun 10, 2011 at 18:41 UTC | |
|
Re: Control Windows Quickbooks with Win32::OLE
by jbryan (Acolyte) on Jan 30, 2014 at 20:47 UTC | |
|
Re: Control Windows Quickbooks with Win32::OLE
by metaperl (Curate) on Nov 19, 2011 at 06:40 UTC |