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.php 3 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
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.php
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
My comments explain a bit towards getting the answer but no comments again.
ASKER
$con = odbc_connect("datatest", "", "");
$Query = "SELECT * FROM names";
$query_exe = odbc_do($con, $Query);
while(odbc_fetch_row($quer
{
#for each of the records found#
print "Found a record<br>";
}
?>