RE: reading vfp dbf files
"Phil Brewer" <[email protected]> Sun, 20 Sep 2015 18:51:54 +0100
| Newsgroups | gmane.comp.lang.perl.active-perl |
|---|---|
| Message-ID | <006e01d0f3cd$098c0180$1ca40480$@com> |
This is a multi-part message in MIME format.
--===============0098517065==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_006F_01D0F3D5.6B506980"
Content-Language: en-gb
This is a multi-part message in MIME format.
------=_NextPart_000_006F_01D0F3D5.6B506980
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Hi John
I did have cause to use the DBI::ODBC driver about eight years ago. To
connect to the database I used something similar to:
$user = ""; $password = "";
$dsno2 = "driver=Microsoft Visual FoxPro
Driver;SourceDB=C:\\<path>\\Comp_A.dbc;SourceType=DBC;Exclusive=No";
unless ($do = DBI->connect("dbi:ODBC:$dsno2",$user,$password, {
odbc_cursortype => 2, ChopBlanks => true, LongReadLen => 65536, LongTruncOk
=> 0 })) {
print "Content-type: text/html\n\n";
print "Error: couldn't connect to database..." . $DBI::errstr . "<br>\n";
print "(Another user may have exclusive access to the database)<br>\n";
exit;
}
It did not work very well for me because the database I was connecting to
needed to be VFP6 and there was a known problem with the driver for that VFP
version... although I believe the VFP9 driver worked correctly.
This was a long time ago but I hope it helps.
Regards
Phil Brewer
From: [email protected]
[mailto:[email protected]] On Behalf Of John
DePasquale
Sent: 19 September 2015 06:13
To: [email protected]
Subject: reading vfp dbf files
Hi all,
I'm trying to track down a database driver for perl that I can use to open
and read dbf files created by visual foxpro. I have a lot of experience
opening/reading dbf files created by dbase/foxpro, but this is the first
time I've tried opening/reading dbfs created by VFP, and those files have a
different format so XBASE drivers won't open them. I've done a lot of
looking around for a VFP driver for perl but am surprised to find it quite
elusive. Do you know if there is a database driver for perl for VFP-created
dbf files?
Thank you.
- john
John DePasquale
Chief Executive Officer
Paradigm Consulting
"Proudly presenting the Vinopedia System"
www.vinopedia.us <http://www.vinopedia.us/>
49 Dalby Street
Newton, MA 02458
Mobile: 617-610-2424
Fax: 617-600-7326
_____
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
------=_NextPart_000_006F_01D0F3D5.6B506980
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40"><head><meta http-equiv=3DContent-Type content=
=3D"text/html; charset=3Dus-ascii"><meta name=3DGenerator content=3D"Micros=
oft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#def=
ault#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
=2Eshape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
=2EMsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1505630137;
mso-list-type:hybrid;
mso-list-template-ids:288397876 455528034 67698691 67698693 67698689 67698=
691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:-;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DEN-GB link=3Dblue vli=
nk=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal><span style=3D'c=
olor:#1F497D'>Hi John<o:p></o:p></span></p><p class=3DMsoNormal><span style=
=3D'color:#1F497D'><o:p> </o:p></span></p><p class=3DMsoNormal><span s=
tyle=3D'color:#1F497D'>I did have cause to use the DBI::ODBC driver about e=
ight years ago. To connect to the database I used something similar to:<o:p=
></o:p></span></p><p class=3DMsoNormal><span style=3D'color:#1F497D'><o:p>&=
nbsp;</o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:8.0pt;f=
ont-family:"Courier New";color:#1F497D'>$user =3D ""; $pass=
word =3D "";<o:p></o:p></span></p><p class=3DMsoNormal><span styl=
e=3D'font-size:8.0pt;font-family:"Courier New";color:#1F497D'>$dsno2 =3D &q=
uot;driver=3DMicrosoft Visual FoxPro Driver;SourceDB=3DC:\\<path>\\Co=
mp_A.dbc;SourceType=3DDBC;Exclusive=3DNo";<o:p></o:p></span></p><p cla=
ss=3DMsoNormal><span style=3D'font-size:8.0pt;font-family:"Courier New";col=
or:#1F497D'><o:p> </o:p></span></p><p class=3DMsoNormal><span style=3D=
'font-size:8.0pt;font-family:"Courier New";color:#1F497D'>unless ($do =3D D=
BI->connect("dbi:ODBC:$dsno2",$user,$password, { odbc_cursorty=
pe =3D> 2, ChopBlanks =3D> true, LongReadLen =3D> 65536, LongTrunc=
Ok =3D> 0 })) {<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D=
'font-size:8.0pt;font-family:"Courier New";color:#1F497D'> prin=
t "Content-type: text/html\n\n";<o:p></o:p></span></p><p class=3D=
MsoNormal><span style=3D'font-size:8.0pt;font-family:"Courier New";color:#1=
F497D'> print "Error: couldn't connect to database..."=
; . $DBI::errstr . "<br>\n";<o:p></o:p></span></p><p class=
=3DMsoNormal><span style=3D'font-size:8.0pt;font-family:"Courier New";color=
:#1F497D'> print "(Another user may have exclusive access =
to the database)<br>\n";<o:p></o:p></span></p><p class=3DMsoNorm=
al><span style=3D'font-size:8.0pt;font-family:"Courier New";color:#1F497D'>=
exit;<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D=
'font-size:8.0pt;font-family:"Courier New";color:#1F497D'>}<o:p></o:p></spa=
n></p><p class=3DMsoNormal><span style=3D'color:#1F497D'><o:p> </o:p><=
/span></p><p class=3DMsoNormal><span style=3D'color:#1F497D'>It did not wor=
k very well for me because the database I was connecting to needed to be VF=
P6 and there was a known problem with the driver for that VFP version... al=
though I believe the VFP9 driver worked correctly.<o:p></o:p></span></p><p =
class=3DMsoNormal><span style=3D'color:#1F497D'><o:p> </o:p></span></p=
><p class=3DMsoNormal><span style=3D'color:#1F497D'>This was a long time ag=
o but I hope it helps.<o:p></o:p></span></p><p class=3DMsoNormal><span styl=
e=3D'color:#1F497D'><o:p> </o:p></span></p><p class=3DMsoNormal><span =
style=3D'color:#1F497D'>Regards<o:p></o:p></span></p><p class=3DMsoNormal><=
span style=3D'color:#1F497D'>Phil Brewer<o:p></o:p></span></p><p class=3DMs=
oNormal><span style=3D'color:#1F497D'><o:p> </o:p></span></p><div><div=
style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm =
0cm'><p class=3DMsoNormal><b><span lang=3DEN-US style=3D'font-size:10.0pt;f=
ont-family:"Tahoma","sans-serif"'>From:</span></b><span lang=3DEN-US style=
=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'> activeperl-bounces=
@listserv.ActiveState.com [mailto:[email protected]=
om] <b>On Behalf Of </b>John DePasquale<br><b>Sent:</b> 19 September 2015 0=
6:13<br><b>To:</b> [email protected]<br><b>Subject:</b> r=
eading vfp dbf files<o:p></o:p></span></p></div></div><p class=3DMsoNormal>=
<o:p> </o:p></p><p class=3DMsoNormal><span lang=3DEN-US style=3D'color=
:#1F497D'>Hi all,<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN=
-US style=3D'color:#1F497D'>I’m trying to track down a database drive=
r for perl that I can use to open and read dbf files created by visual foxp=
ro. I have a lot of experience opening/reading dbf files created by dbase/f=
oxpro, but this is the first time I’ve tried opening/reading dbfs cre=
ated by VFP, and those files have a different format so XBASE drivers won&#=
8217;t open them. I’ve done a lot of looking around for a VFP driver =
for perl but am surprised to find it quite elusive. Do you know if there is=
a database driver for perl for VFP-created dbf files?<o:p></o:p></span></p=
><p class=3DMsoNormal><span lang=3DEN-US style=3D'color:#1F497D'>Thank you.=
<o:p></o:p></span></p><p class=3DMsoListParagraph style=3D'text-indent:-18.=
0pt;mso-list:l0 level1 lfo2'><![if !supportLists]><span lang=3DEN-US style=
=3D'color:#1F497D'><span style=3D'mso-list:Ignore'>-<span style=3D'font:7.0=
pt "Times New Roman"'>  =
; </span></span></span><![endif]><span lang=3DEN-US style=3D'color:#1F497D'=
>john<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US style=3D=
'color:#1F497D'><o:p> </o:p></span></p><div><p class=3DMsoNormal><span=
lang=3DEN-US style=3D'color:#1F497D'>John DePasquale<o:p></o:p></span></p>=
<p class=3DMsoNormal><span lang=3DEN-US style=3D'color:#1F497D'>Chief Execu=
tive Officer<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US s=
tyle=3D'color:#1F497D'>Paradigm Consulting<o:p></o:p></span></p><p class=3D=
MsoNormal><i><span lang=3DEN-US style=3D'color:#1F497D'>“Proudly pres=
enting the Vinopedia System”<o:p></o:p></span></i></p><p class=3DMsoN=
ormal><span lang=3DEN-US style=3D'color:#1F497D'><a href=3D"http://www.vino=
pedia.us/">www.vinopedia.us</a><o:p></o:p></span></p><p class=3DMsoNormal><=
span lang=3DEN-US style=3D'color:#1F497D'>49 Dalby Street<o:p></o:p></span>=
</p><p class=3DMsoNormal><span lang=3DEN-US style=3D'color:#1F497D'>Newton,=
MA 02458<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-U=
S style=3D'color:#1F497D'>Mobile: 617-610-2424<o:p></o:p></span></p><p clas=
s=3DMsoNormal><span lang=3DEN-US style=3D'color:#1F497D'>Fax: 617-600-7326<=
/span><span lang=3DEN-US style=3D'font-family:"Verdana","sans-serif";color:=
#1F497D'><o:p></o:p></span></p><div class=3DMsoNormal align=3Dcenter style=
=3D'text-align:center'><span lang=3DEN-US style=3D'font-family:"Verdana","s=
ans-serif";color:#1F497D'><hr size=3D2 width=3D"100%" align=3Dcenter></span=
></div></div></div>
<br /><br />
<hr style=3D'border:none; color:#909090; background-color:#B0B0B0; height: =
1px; width: 99%;' />
<table style=3D'border-collapse:collapse;border:none;'>
<tr>
<td style=3D'border:none;padding:0px 15px 0px 8px'>
<a href=3D"https://www.avast.com/antivirus">
<img border=3D0 src=3D"http://static.avast.com/emails/avast-mail-stamp.=
png" alt=3D"Avast logo" />
</a>
</td>
<td>
<p style=3D'color:#3d4d5a; font-family:"Calibri","Verdana","Arial","Helv=
etica"; font-size:12pt;'>
This email has been checked for viruses by Avast antivirus software.
<br><a href=3D"https://www.avast.com/antivirus">www.avast.com</a>
</p>
</td>
</tr>
</table>
<br />
</body></html>
------=_NextPart_000_006F_01D0F3D5.6B506980--
--===============0098517065==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0098517065==--