Link to home
Start Free TrialLog in
Avatar of phenixfilms
phenixfilms

asked on

PHP Excel Query

hello,
I'm very familiar with querying MS Access databases.  To this point I have had not problems.  I am being forced to query an Excel file now and am having countless problems.  I am using the following code to connect to the database:

$con = odbc_connect("datatest", "", "");

that works great!

when I attempt to query a datasheet named 'names' I get the following error:

Warning: SQL error: [Microsoft][ODBC Excel Driver] The Microsoft Jet database engine could not find the object 'names'. Make sure the object exists and that you spell its name and the path name correctly., SQL state S0002 in SQLExecDirect in c:\phpdev\www\connect2.php3 on line 4

it is able to connect to the excel database datatest so I know that the Excel datasource is working.

If anyone can provide the solution i'd be very greatful.

Nathan
ASKER CERTIFIED SOLUTION
Avatar of lokeshv
lokeshv

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of phenixfilms
phenixfilms

ASKER

<?
$con = odbc_connect("datatest", "", "");
$Query = "SELECT * FROM names";
$query_exe = odbc_do($con, $Query);
while(odbc_fetch_row($query_exe))
{
#for each of the records found#
print "Found a record<br>";
}

?>
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
My comments explain a bit towards getting the answer but no comments again.