Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( #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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (6)
    As of 2020-12-01 03:09 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?