ChilliHead has asked for the wisdom of the Perl Monks concerning the following question:

I got the following error while trying to insert a record into an access database:

DBD::ODBC::st execute failed: Microsoft ODBC Microsoft Access Driver Invalid precision value (SQL-S1104)(DBD: _rebind_ph/SQLBindParameter err=-1) at testodbc.pl line 14

I'm using the DBI ODBC driver rather than any Win32 functions because I want to be able to port the program to my Linux server.
I don't think this is an Access error because the same SQL statement works using ADO/Visual Basic.
Has anybody got any ideas what could be causing this error?

CH
  • Comment on Bizarre error inserting data into an Access database.

Replies are listed 'Best First'.
Re: Bizarre error inserting data into an Access database.
by repson (Chaplain) on Jan 01, 2001 at 05:29 UTC
    This error look like it may be due to incorrect type conversion or something like that.
    The best information I was able to find suggested two slight possibilities.
    1- You are trying to put too long a string into a character field and DBI is not tructating it so ODBC or the database is complaining, solution: try different data.
    2- Perl and DBI are confusing type of numbers and their precision: solution tell it exactly what to use:
    $sth->bind_param(1, $value, { TYPE => SQL_INTEGER });

    That was the closest I could get to a solution, maybe try giving us full detail on code used, data tables in the database and what you are trying to insert. However it may still be a bug in DBI,DBD::ODBC for which you would have to contact the author.

      You were right, I was trying to insert a string that was too long (longer than 255).

      thanks for the help.

      CH