ODBC text driver problem
| From: | Ethan Nelson | Date: | Tue, 10 Sep 2002 20:06:37 +0000 |
| Subject: | ODBC text driver problem | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-21680@lists.php.net to get a copy of this message | ||
Hello,
I'm having trouble connecting via ODBC using the Microsoft text driver on a win2k box. I read
the KB article at http://support.microsoft.com/default.aspx?scid=kb;en-us;Q178717
and it seems to suggest that I should be able to select data from a text source. Here is what I
have so far:
odbc_close_all();
$odbc = odbc_connect("cvalcoinput","","") OR die("There is an
error connecting to the CSV file.");
$result = odbc_tables($odbc);
odbc_fetch_into($result, $fields)
print_r($fields);
-------------------------
unset($fields);
$result = odbc_exec($odbc,"SELECT * from inputfile.txt");
odbc_fetch_into($result, $fields)
print_r($fields);
The connection and following tables commands work great, but when I actually select data via the
odbc_exec command, I get the following error:
Warning: SQL error: [Microsoft][ODBC Text Driver] The Microsoft Jet database engine \
cannot open the file '(unknown)'. It is already opened exclusively by another user, \
or you need permission to view its data., SQL state S1000 in SQLExecDirect in \
***:\***\***\***\basecsv2.html on line 53
Any ideas?
-Ethan, Modulus, LLC