[Lazarus] Problem working with Params in TSQLQuery

Eduardo Lopez dar_alle at yahoo.com.ar
Tue Aug 19 16:31:24 CEST 2008


Hi Osvaldo.

This was working with UIB and fpc 2.2.0.
When change to fpc 2.2.2 the UIB 2.1 don't work anymore.

I've tried the svn version of UIB, but i can't make it compile. Because it, i began to try the sqldb an zeoslib (with just a "new" stable release..)

Thanks!!. Eduardo.





----- Mensaje original ----
De: Osvaldo Filho <arquivostcf at gmail.com>
Para: General mailing list <lazarus at lazarus.freepascal.org>
Enviado: martes 19 de agosto de 2008, 10:30:59
Asunto: Re: [Lazarus] Problem working with Params in TSQLQuery


try UIB + FBDataset. Is very, very good.


2008/8/18 Eduardo Lopez <dar_alle at yahoo.com.ar>

The scenario:

Lazarus 0.9.25   svn: 16095M
fpc 2.2.2
Ubuntu 8.04 GTK2
SQLDb components
TIBConnection

The following query works well:

   qry02.SQL.Clear;
   qry02.SQL.Text:= 'select PASSWOR from USUARIOS where CODUSU = ' +
chr(39) + trim(pUsuario) + chr(39);
   trn02.Active:=true;
   qry02.Open;
   ContrasenaDB:=qry02.FieldByName('PASSWOR').AsString;         // <--
ContrasenaDB get the value from the query


But this one don't get the value of 'PASSWOR':

   qry02.SQL.Clear;
   qry02.SQL.Text:= 'select PASSWOR from USUARIOS where CODUSU = :pCODUSU';
   qry02.Params.ParamByName('pCODUSU').AsString:= trim(pUsuario);
   trn02.Active:=true;
   qry02.Open;
   ContrasenaDB:=qry02.FieldByName('PASSWOR').AsString;        // <---
ContrasenaDB is empty

(The second code was working with fpc 2.2.0 and the UIB components, with
some changes. When upgrade to fpc 2.2.2 i began to replace de UIB with
the default SQLDb componentes).

TIA.

Eduardo.



_______________________________________________
Lazarus mailing list
Lazarus at lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


      ____________________________________________________________________________________
¡Buscá desde tu celular!

Yahoo! oneSEARCH ahora está en Claro

http://ar.mobile.yahoo.com/onesearch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20080819/bddf25fd/attachment-0007.html>


More information about the Lazarus mailing list