Page 1 of 1

ODBC Error

Posted: Fri 15 Oct 2010 18:00
by whh518
Hi,evrybody.I need your help.I set UniConnection' Provider as ODBC to access MS Access database.But when program run to this query , A error message will popup."[ODBC Microsoft Access Driver] Invalid precision Value".
This is my query :
With Query3 Do
Begin
Close;
With SQL Do
Begin
Clear ;
Add('SELECT * FROM LockSerialID');
Add('WHERE SerialID = :SerialID');
End;
ParamByName('SerialID').Value := TempString;
Open ;
End;

The TempString is a string and do not empty.

Help me,please.[/img]

Posted: Mon 18 Oct 2010 09:16
by AlexP
Hello,

You can use AccessUniProvider instead of ODBCUniProvider for connecting to MS Access.
AccessUniProvider was build with taking into account the specific features MS Access, and if you use it, you will not have this problem.
If you still want to use ODBCUniProvider, you should set the data type of parameter to ftMemo, like
ParamByName('SerialID').DataType:= ftMemo;