![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi world, I use to connect to fox pro using perl very easyly with the odbc drivers on win 98. However it seems to be very different on an XP box. I lost many hours trying to find how to, a faq or an example without luck. Anyone out there could tell me how to do it? Respect, Fred Andre |
#3
| |||
| |||
|
|
Are you trying to connect to a VFP COM DLL, or are you just trying to access VFP data? |
|
What version of VFP created the table |
|
Is the data in a table that is free or part of a database? |
#4
| |||
| |||
|
|
First of all thanks for your time Rick. Below I tried to answer the questions you raised and I give you a basic snipet of code to show you what we use to do with odbc and win 98 (see below) and try to do under xp. Would you have a basic perl example that works under xp with the ole drivers and / or a basic guide to what as to be done to set the ole stuff. Are you trying to connect to a VFP COM DLL, or are you just trying to access VFP data? not shure maybe the code can answer that querstion. What version of VFP created the table Version 6 Is the data in a table that is free or part of a database? we can access the diferent files representing tables but they are part of a relational database ------------------- code snipet start ---------------------- use strict; use DBI(); my $dbh = DBI->connect("dbi:ODBC:EnyoLiveOpera", "logon","password" , { RaiseError => 1, odbc_cursortype => 2}); # Now retrieve data from the table. my $sth = $dbh->prepare("select IT_DOC from itran where IT_DOC like '%12%';"); $sth->execute(); while (my $ref = $sth->fetchrow_hashref()) { print "Found a row: IT_DOC = $ref->{'IT_DOC'}"; } $sth->finish(); # Disconnect from the database. $dbh->disconnect(); ------------------- code snipet end ---------------------- thanks again, Fred |
#5
| |||
| |||
|
#6
| |||
| |||
|
|
Hi again Rick, yes the odbc drivers work very well under 98. We have been using them for years but are not supported (and don't work under xp) this is why we need the ole stuff. Do you have any code (in any language) that access vfp through the ole stuff. Thanks, Fred ps: the select syntax is corect for perl. |
#7
| |||
| |||
|
#8
| |||
| |||
|
|
Rick, Thanks for the code bit. We couldn't find the odbc driver for xp as microsoft says openly that they don't support odbc on xp. We found some for 98 NT and 2000 but none for xp. Are those the one you are using on xp ? If yes did you set them up with no problems ? Once again, Thanks for your time. Fred |
#9
| |||
| |||
|
#10
| |||
| |||
|
|
First of all thanks for your time Rick. Below I tried to answer the questions you raised and I give you a basic snipet of code to show you what we use to do with odbc and win 98 (see below) and try to do under xp. Would you have a basic perl example that works under xp with the ole drivers and / or a basic guide to what as to be done to set the ole stuff. Are you trying to connect to a VFP COM DLL, or are you just trying to access VFP data? not shure maybe the code can answer that querstion. What version of VFP created the table Version 6 Is the data in a table that is free or part of a database? we can access the diferent files representing tables but they are part of a relational database ------------------- code snipet start ---------------------- use strict; use DBI(); my $dbh = DBI->connect("dbi:ODBC:EnyoLiveOpera", "logon","password" , { RaiseError => 1, odbc_cursortype => 2}); # Now retrieve data from the table. my $sth = $dbh->prepare("select IT_DOC from itran where IT_DOC like '%12%';"); $sth->execute(); while (my $ref = $sth->fetchrow_hashref()) { print "Found a row: IT_DOC = $ref->{'IT_DOC'}"; } $sth->finish(); # Disconnect from the database. $dbh->disconnect(); ------------------- code snipet end ---------------------- thanks again, Fred |
![]() |
| Thread Tools | |
| Display Modes | |
| |