Page 1 of 1

Insert record to MS Access

Posted: Thu Sep 21, 2006 6:32 am
by sulfikkartm
onion2k | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


How can I insert records into a MS Access database using odbc, when iam trying to do the follwing iam getting an error message


Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query., SQL state S1000 in SQLExecDirect in C:\Inetpub\wwwroot\phpdemo\insert.php on line 5

PHP Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query., SQL state S1000 in SQLExecDirect in C:\Inetpub\wwwroot\phpdemo\insert.php on line 5 
 

My Program is look like :-

Code: Select all

<?php
$conn=odbc_connect('ss','','');
//$sql="insert into student values(106,'Sulf','Ekm')"; 
$r=odbc_exec($conn,$sql);

?>
please help in this regard


onion2k | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Thu Sep 21, 2006 8:04 am
by onion2k
Why have you commented out the line that defines $sql?