php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11571 cannot insert data in msaccess
Submitted: 2001-06-20 00:51 UTC Modified: 2001-07-06 10:39 UTC
From: sugus_24 at yahoo dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.0.5 OS: w2k
Private report: No CVE-ID: None
 [2001-06-20 00:51 UTC] sugus_24 at yahoo dot com
hello.

my script is :
-----------------------------
<?
   /* connect database */
   $dsn = "nawa_dsn";
   $user = "";
   $pw = "";
   $conn = odbc_connect($dsn,$user,$pw);
   $sql = "insert into TB_Login (UserID,Name) values ('002','Somphob')";

   /* check for errors */ 
   if (!odbc_exec($conn,$sql)) { 
      /* error */ 
      echo "Error";
   } 
   else {
      echo "OK!";
   }

   /* close connection */ 
   odbc_close($conn);
?>
-----------------------------

and result is :
-----------------------------
Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query., SQL state S1000 in SQLExecDirect in c:\inetpub\wwwroot\customer\save.php on line 12

Error
-----------------------------
please tell me. thank.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-21 11:11 UTC] kalowsky@php.net
script works fine for me.  are you sure you haven't given out your DSN in read only mode, or possibly requiring a user?
 [2001-07-06 10:39 UTC] kalowsky@php.net
no user feedback.
 [2002-10-01 17:13 UTC] yangliu89 at yahoo dot com
I experienced the same problem, my coding is almost the same as yours. Just wonder if you ever found out the solution.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 19:01:31 2024 UTC