|
Posted by Tim Burgan on 01/20/05 00:43
Hello,
I'm trying to insert a new row using the following SQL:
$db_sql = "INSERT INTO tblStudents (name, username, password, expiry,
permissions, website, displayUser) VALUES ('Joe',
'joejoe','pw4joe','20-Jan-05','staff','true','false');";
In using MS Access via COM, the data types for each column (in order)
is: string, string, string, date, string, boolean, boolean.
I am continually getting a data type mismatch error (relating to the
boolean columns) when trying to execute this code.
I've tried removing the single quotes, but that returns a syntax error.
What do I do? Any assistance would be greatly appreciated.
Tim
PS: For those that are unclear of who COM works, this is my code to
connect to the database with a DNS-less connection.
/* Open the connection to the database */
$db_connection = new COM("ADODB.Connection") or die("Cannot start ADO");
$db_connstr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=".
realpath("../data2004/contentdb01.mdb") .";DefaultDir=".
realpath("../data2004");
$db_connection->open($db_connstr);
/* Set the SQL */
$db_sql = "INSERT INTO tblStudents (name, username, password, expiry,
permissions, website, displayUser) VALUES ('Joe',
'joejoe','pw4joe','20-Jan-05','staff','true','false');";
/* Execute SQL */
$rs = $db_connection->execute($db_sql);
/* Close the database connection */
$db_connection->Close();
$rs = null;
$db_connection = null;
[Back to original message]
|