Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] DBI ODBC 255 char limit on memo field

Expand Messages
  • Don Smith
    Thanks for the response Steven, I do pass all form variables through a subroutine to check for malicious code, however, I use the same sub in other scripts and
    Message 1 of 3 , Nov 4, 2004
    • 0 Attachment
      Thanks for the response Steven,

      I do pass all form variables through a subroutine to check for malicious code,
      however, I use the same sub in other scripts and have no problem. In fact, I
      know $notes passes through it and comes out the other side just fine because, as
      a troubleshooting step, I appended $note to " die print "Could not execute the
      query $!."; " and it prints the entire note, so I'm guessing that either DBI or
      ODBC doesn't like $note when its more than 255 characters.

      Cheers,

      Don


      ----- Original Message -----
      From: "Riviere Informatique SARL" <svdbeek@...>
      To: <perl-beginner@yahoogroups.com>
      Sent: Thursday, November 04, 2004 11:06 AM
      Subject: Re: [PBML] DBI ODBC 255 char limit on memo field



      Don't know enough about Access or ODBC limits, but are you maybe using a
      function to avoid overflow, such as substr, on the value to populate
      notes? That could cause your problem. If this is the case, use perl to
      limit the size of the string.

      Good luck,
      Steven.

      Don Smith wrote:

      >Greetings folks,
      >
      >This is a strange problem. I have a script (below) that writes text to a
      database.
      >
      >$notes seems to have a 255 character limit on it despite the fact the
      >field in MS Access 2003 is "Memo" and I can copy & paste the note directly
      >into the field with no problem.
      >
      >254 characters submits fine. 255 causes a "Could not execute the query
      >Bad File descriptor" "OK The server encountered an internal error or
      >misconfiguration and was unable to complete your request."
      >
      >
      ># Begin log script #
      >
      >my $DSN = "DSN_Name";
      >my $username = undef;
      >my $password = undef;
      >
      >
      >my $dbh = DBI->connect("dbi:ODBC:$DSN",$username,$password);
      >my $sql1 = "INSERT INTO fileLog (file, statusRef, shortfilename,
      >version, sizeKB, uploadDateTime, uploadBy, notes, status, deletedBy,
      >deletedDate)
      >VALUES (?,?,?,?,?,?,?,?,?,?,?)";
      >
      >my $sth = $dbh->prepare($sql1);
      >
      >$sth->execute ($file, $status_ref, $fileName, $MV, $sizeKB, $Date,
      >$uploadBy, $notes, 'Active', undef, undef) ||
      > die print "Could not execute the query $!.";
      >
      >$sth->finish;
      >$dbh->disconnect();
      >
      ># End log script #
      >
      >Any ideas as to whether this could be a DBI or ODBC issue? I spent 4 hours
      researching it last evening and I'm no closer to a solution.
      >
      >Thanks for any help.
      >
      >Don
      >
      >
      >
      >
      >
      >---
      >Outgoing mail is certified Virus Free.
      >Checked by AVG anti-virus system (http://www.grisoft.com).
      >Version: 6.0.788 / Virus Database: 533 - Release Date: 01/11/04
      >
      >
      >[Non-text portions of this message have been removed]
      >
      >
      >
      >
      >Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
      >Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >



      Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
      Yahoo! Groups Links









      ---
      Outgoing mail is certified Virus Free.
      Checked by AVG anti-virus system (http://www.grisoft.com).
      Version: 6.0.788 / Virus Database: 533 - Release Date: 01/11/04
    Your message has been successfully submitted and would be delivered to recipients shortly.