note
planetscape
<p>Hopefully this will be enough now to get you started:</p>
<p>[http://msdn.microsoft.com/library/en-us/dv_foxhelp/html/dgControlling_Visual_FoxPro_from_Other_Applications.asp|Control of Visual FoxPro 8.0 from Other Applications]</p>
<p>I've cobbled together a short example of how to get the proper object reference and do one simple method, because I am really <i>not</i> an expert in automating via Perl:</p>
<code>
#!/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\Samples\Tastrade\Data\customer"');
my @arr = $objVFP->RequestData('Customer',5);
print Dumper(\@arr);
</code>
<p>The output from this snippet follows:</p>
<code>
$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',
' '
]
]
];
</code>
<p>HTH,</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-442602">
<font color="#8000ff">p</font><font color="#8b00f3">l</font><font color="#9700e7">a</font><font color="#a200dc">n</font><font color="#ae00d0">e</font><font color="#b900c5">t</font><font color="#c500b9">s</font><font color="#d000ae">c</font><font color="#dc00a2">a</font><font color="#e70097">p</font><font color="#f3008b">e</font>
</div></div>
484305
484305