Richard, Simple example using MS SQL Server:
<?php $dsn="Northwind"; $usr="sa"; $pwd=""; $qual="Northwind"; $owner="dbo"; $table="Orders"; $conn_id = odbc_connect($dsn, $usr, $pwd) or die (odbc_error()); $result_id = odbc_primarykeys($conn_id, $qual, $owner, $table) or die (odbc_error()); odbc_result_all($result_id); ?> Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -----Original Message----- > From: Richard Black [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 04, 2002 10:36 AM > To: '[EMAIL PROTECTED]' > Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' > Subject: [PHP-DB] odbc functions > > > Does anyone have experience of using odbc_primarykeys??? > > I'm writing a script to let me port a database from Access to > MySQL without > having to write all the table definitions by hand. But I can't get > odbc_primarykeys to work - it comes back with: > > Warning: SQL error: , SQL state 00000 in SQLPrimaryKeys > > I don't really know what the modifier and owner parameters should do, and > suspect thats where the problem lies. I tried them as "", "%" and " ". > > Running PHP 4.0.4 on NT 4.0 Workstation, with Access 97 > > Richy. > > > ========================================== > Richard Black > Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com > Tel: 0141 435 3504 > Email: [EMAIL PROTECTED] > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php