I'm trying to insert data to my Microsoft Access database but it alway gives me this error:
Warning: main(): PropGet() failed: Exception occurred. Source: ADODB.Recordset Description: Operation is not allowed when the object is closed. in D:\html\users\bci\index.php on line 106
here is my code line 106 is marked with
$db = 'd:/html/users/cashyourclothescom/database/cyc.mdb';
$conn = new COM('ADODB.Connection');
$conn->Open("DRIVER={Microsoft Access Driver (.mdb)}; DBQ=$db;");
$sql = "INSERT INTO UserAccount (email, password, firstName, lastName, payPal, address1, address2, city, state, zip, mailing) VALUES('$email', '$password', '$firstName', '$lastName', '$paypal' , '$address', '$address1', '$city', '$state', '$zip', '$mailing')";
****$result = $conn->Execute($sql);****
if($result){
echo "DONE";}
}
Does anyone know what is wrong?