I'm just playing around with php and see its capability interacting with MS Acess. I also don't have direct access to the server, its hosted remotely.
ok, basically i'm getting an error when i try to insert or update anything to the db file.
This is the error I get:
"Warning: Invoke() failed: Exception occurred. Source: Microsoft JET Database Engine Description: Operation must use an updateable query. in..... line 43"
This is line 43:
$objRS = $objConn->Execute($strSQL);
Obviously that doesn't make sense without the above and below code.
its here: (trimmed the fat)
// it is in double backslash, but vb is just showing it as single backslash
define('DATA_DB', 'd:\\path\\to\\database\\test.mdb');
function objConn(){
global $objConn;
$objConn = new COM('ADODB.Connection');
//$objConn->Provider = 'Microsoft.Jet.OLEDB.4.0';
//$objConn->Open(DATA_DB);
//$objConn->Open('DRIVER={Microsoft Access Driver (*.mdb)}; DBQ='.DATA_DB);
$objConn->Open('Provider=Microsoft.Jet.OLEDB.4.0; Data Source='.DATA_DB);
}
// inserting data from form
$data = array();
$data['title'] = $_POST['title'];
$data['desc'] = $_POST['desc'];
$data['id'] = $_POST['id'];
$data['date_exp'] = date('h:i:s a');
$strSQL = 'UPDATE tblDetails SET title = "'.$data['title'].'", desc = "'.$data['desc'].'", expires = "'.$data['date_exp'].'", revised = "now()" WHERE id = '.$data['id'];
objConn();
$objRS = $objConn->Execute($strSQL);
objClose($objConn, $objRS);
echo $strSQL;
exit;
Also, i can sort through any records without any problems.
Does anyone have any suggestions.
Thanks.