I have a problem when I try to read a memo field from an Access DB using PHP. I get an error...

Warning: SQL error: [Microsoft][ODBC Driver Manager] Invalid cursor state, SQL state 24000 in SQLGetData in .....

I have found info that says you can't read a memo field twice (which I'm not doing)
OR to change your type to text (max lenght of 255)

I know someone is going to say use a MySQL DB instead.... but this is a school project, so I don't get much say!

Thanks!

lil_geek

    8 months later

    Anyone have a solution to this? I think I am experiencing the same problem.

      hope this example helps, you need php 4+ I think

      <?
      //Connection string for ADO
      $db_connection5 = new COM("ADODB.Connection"); 
      //Location and driver for conencting to access database
      $db_connstr5 = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("Customize.mdb") ." ;DefaultDir=". realpath("../php"); 
      //Open database and access records
      $db_connection5->open($db_connstr5); 
      //Use Query String here
      $rs5 = $db_connection5->execute("SELECT * FROM Customize"); 
       //This is just like Mysql, just define the varibles for the fields
       //Note that $rs5->Fields(2) you absicly count each feils and sue the numebers not what there called
       //Like lets say you have 3 fileds, ID, NAME, LNAME
       // ID = 0, NAME = 1, LNAME =2
        $fname33 = $rs5->Fields(2);
        $lname33 = $rs5->Fields(3);
        //Get records
        while (!$rs5->EOF) { 
        //Display results
      echo "<span class='WhiteB9'>Welcome $fname33->value $lname33->value</span> &nbsp;&nbsp;&nbsp;";
      //Goto next record
        $rs5->MoveNext();
      } 
      //Close conenction
      $rs5->Close(); 
      $db_connection5->Close(); 
      ?>
      
        Write a Reply...