Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Hopefully this will be enough now to get you started:

Control of Visual FoxPro 8.0 from Other Applications

I've cobbled together a short example of how to get the proper object reference and do one simple method, because I am really not an expert in automating via Perl:

#!/usr/bin/perl use strict; use warnings; use Win32::OLE; use Data::Dumper; my $objVFP = Win32::OLE->new('VisualFoxPro.Application') or die "oops\ +n"; $objVFP->DoCmd('USE "C:\Program Files\Microsoft Visual FoxPro 7\Sample +s\Tastrade\Data\customer"'); my @arr = $objVFP->RequestData('Customer',5); print Dumper(\@arr);

The output from this snippet follows:

$VAR1 = [ [ [ 'ALFKI ', 'Alfreds Futterkiste ', 'Maria Anders ', 'Sales Representative ', 'Obere Str. 57 + ', 'Berlin ', ' ', '12209 ', 'Germany ', '030-0074321 ', '030-0076545 ', '6300', '2600', '2', ' ' ], [ 'ANATR ', 'Ana Trujillo Emparedados y helados ', 'Ana Trujillo ', 'Owner ', 'Avda. de la Constituci≤n 2222 + ', 'MΘxico D.F. ', ' ', '05021 ', 'Mexico ', '(5) 555-4729 ', '(5) 555-3745 ', '3500', '1900', '5', ' ' ], [ 'ANTON ', 'Antonio Moreno Taquerφa ', 'Antonio Moreno ', 'Owner ', 'Mataderos 2312 + ', 'MΘxico D.F. ', ' ', '05023 ', 'Mexico ', '(5) 555-3932 ', ' ', '8500', '1700', '6', ' ' ], [ 'AROUT ', 'Around the Horn ', 'Thomas Hardy ', 'Sales Representative ', '120 Hanover Sq. + ', 'London ', ' ', 'WA1 1DP ', 'UK ', '(71) 555-7788 ', '(71) 555-6750 ', '17100', '0', '1', ' ' ], [ 'BERGS ', 'Berglunds snabbk÷p ', 'Christina Berglund ', 'Order Administrator ', 'BerguvsvΣgen 8 + ', 'Luleσ ', ' ', 'S-958 22 ', 'Sweden ', '0921-12 34 65 ', '0921-12 34 67 ', '28600', '4900', '0', ' ' ] ] ];

HTH,

planetscape

In reply to Re: Perl as a test tool for Foxpro apps? by planetscape
in thread Perl as a test tool for Foxpro apps? by talwyn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-19 03:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found