Jump to content


Photo

Hooking to visual fox pro table?


  • Please log in to reply
2 replies to this topic

#1 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 28 March 2006 - 01:56 PM

anyone had success hooking to visual fox pro table? is there an odbc avail? I do access all the time, but seem to have problems with this...


#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 28 March 2006 - 01:58 PM

I would imagine you could use ODBC or some sort of COM object to talk to it. I've never tried it, however.

[a href=\"http://us2.php.net/manual/en/function.dbase-open.php\" target=\"_blank\"]http://us2.php.net/manual/en/function.dbase-open.php[/a]

You might want to read the comment at the bottom of that page.

Info: PHP Manual


#3 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 28 March 2006 - 05:47 PM

Well, I got it, but how do I make this not so sloooooooooowwwwwwwww....

<?php
$i=1;
$user="";
$host="localhost";
$password="";

$database = "teknetix";

mysql_connect($host,$user,$password);

mysql_select_db($database);

$kill=mysql_query("delete from firstpass") or die("kill:".mysql_error());

$connect = odbc_connect("QES9000", "", "");
$query = "SELECT itdatshta.`it_date`, itdatshta.`insptype`, itdatshta.`process`, itdatshta.`product`, itdatshta.`descr`,
itdatshta.`rev_level`, itdatshta.`serialno`, itdatshta.`failed`
FROM `itdatshta` itdatshta";
$result = odbc_do($connect, $query);
WHILE($row=odbc_fetch_array($result))
{
$it_date=$row['it_date'];
$insptype=$row['insptype'];
$process=$row['process'];
$product=$row['product'];
$descr=$row['descr'];
$rev_level=$row['rev_level'];
$serialno=$row['serialno'];
$failed=$row['failed'];
$query = mysql_query
("insert into firstpass (it_date, insptype, process, product, descr, rev_level, serialno, failed) values ('$it_date', '$insptype', '$process', '$product', '$descr', '$rev_level', '$serialno', '$failed')") or die(mysql_error());
echo $i;
echo "\n";
$i++;
}
odbc_close($connect);
?>




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users