ODBC Error

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
whh518
Posts: 1
Joined: Fri 15 Oct 2010 03:35

ODBC Error

Post by whh518 » Fri 15 Oct 2010 18:00

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]

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 18 Oct 2010 09:16

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;

Post Reply