Hello All,
I am having great problems getting new records etc into an MSAccess databse.
Current Config:
Win2k Server
Apache 1.3.27
PHP 4.2.3
I can access the MSAccess database and retrieve records fine using the this code
<?
$doc_root = $_SERVER['DOCUMENT_ROOT'];
$dbc = new COM("ADODB.Connection");
$dbc->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$doc_root/cgi-bin/rocket2000.mdb");
$rs = $dbc->Execute("SELECT FlightLog.RocketNameID FROM FlightLog WHERE (((FlightLog.RocketNameID)=8));");
$CurrentFlights = 0;
while (!$rs->EOF)
{
$CurrentFlights=$CurrentFlights + 1;
$rs->MoveNext();
}
$rs->Close();
$rs = null;
$dbc->Close();
$dbc = null;
?>
(Got this coding from the OLEDB section in http://php.weblogs.com/com_php )
but if I want to add a new record to the database it always fails.
I have tried SQL Inserts, rs.addnew etc.
What is the correct format for puting a new record into a msaccess database using the OLEDB format used above.
Lets say I have a table called test in the rocket2000.mdb with on field call FNAME
I want to put a php variable $firstname in this FNAME field in the test table in the rocket2000.mdb
I have looked at a huge amount of web pages, but san not find anything that resembles any help.
Cheers and thanks.