Re: [Lazarus] Problem working with Params in TSQLQuery
Op dinsdag 19-08-2008 om 17:11 uur [tijdzone +0200], schreef Michael Van Canneyt: On Tue, 19 Aug 2008, Eduardo Lopez wrote: Yes!! It works now.!! My challenge is now: a) modify all my db structure or b) replace the sqldb components with zeos. Or pad your parameters. Meanwhile I think I know why the problem exists, I will consult with Joost for a test and possible solution. The problem is fixed in trunk. If you don't want to use trunk, or find it too much of a hassle. You can just place the new 'ibconnection.pp' unit in the search-path of your project. (http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/packages/fcl-db/src/sqldb/interbase/ibconnection.pp?revision=11629) Can you try and please give some feedback, so we know it's really solved? Joost. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
On Tue, Aug 19, 2008 at 04:47:51PM +0200, Bogus??aw Brandys wrote: Eduardo. c) write padding function strutils? ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
On Mon, 18 Aug 2008, Eduardo Lopez wrote: Joost van der Sluis escribió: I isolate the problem doing a simple program and the problem remains. Then make a copy of this simple program and change the components to Zeos. (6.6.3-stable) and works well. I'll consider change the sqldb components for Zeos in my application as a possible solution. But the sqldb must be work (i think :-) ). Offcourse, but then we have to find the problem. Parameters do work here, also in the testsuite. What happens if you remove the 'trim' in both cases? (Without the parameter and with?) I tried and nothing happens. I prepare the sample proyect, if someone want to see it and can find what stupid thing i'm doing... ;-) http://www.sistemasrpm.com.ar/soporte/test_param.tar.g I get a permission denied error trying to access this URL, and the same when I add a .gz Michael.___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
Michael Van Canneyt schreef: On Mon, 18 Aug 2008, Eduardo Lopez wrote: http://www.sistemasrpm.com.ar/soporte/test_param.tar.g I get a permission denied error trying to access this URL, and the same when I add a .gz I can download: http://www.sistemasrpm.com.ar/soporte/test_param.tar.gz Vincent ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
On Mon, 18 Aug 2008, Eduardo Lopez wrote: Joost van der Sluis escribió: I isolate the problem doing a simple program and the problem remains. Then make a copy of this simple program and change the components to Zeos. (6.6.3-stable) and works well. I'll consider change the sqldb components for Zeos in my application as a possible solution. But the sqldb must be work (i think :-) ). Offcourse, but then we have to find the problem. Parameters do work here, also in the testsuite. What happens if you remove the 'trim' in both cases? (Without the parameter and with?) I tried and nothing happens. I prepare the sample proyect, if someone want to see it and can find what stupid thing i'm doing... ;-) http://www.sistemasrpm.com.ar/soporte/test_param.tar.g Can you please provide the CREATE statement for the table ? Without the correct table definition, it's hard to test. Michael.___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
On Tue, 19 Aug 2008, Vincent Snijders wrote: Michael Van Canneyt schreef: On Mon, 18 Aug 2008, Eduardo Lopez wrote: http://www.sistemasrpm.com.ar/soporte/test_param.tar.g I get a permission denied error trying to access this URL, and the same when I add a .gz I can download: http://www.sistemasrpm.com.ar/soporte/test_param.tar.gz Hehe, it's anti-robot measures. But I can circumvent that :-) gru: wget http://www.sistemasrpm.com.ar/soporte/test_param.tar.gz --09:43:58-- http://www.sistemasrpm.com.ar/soporte/test_param.tar.gz = `test_param.tar.gz' Resolving www.sistemasrpm.com.ar... 201.216.232.68 Connecting to www.sistemasrpm.com.ar|201.216.232.68|:80... connected. HTTP request sent, awaiting response... 403 Forbidden 09:44:01 ERROR 403: Forbidden. gru: wget --user-agent=Konqueror http://www.sistemasrpm.com.ar/soporte/test_param.tar.gz --09:44:53-- http://www.sistemasrpm.com.ar/soporte/test_param.tar.gz = `test_param.tar.gz' Resolving www.sistemasrpm.com.ar... 201.216.232.68 Connecting to www.sistemasrpm.com.ar|201.216.232.68|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 2,842 (2.8K) [application/x-gzip] 100%[] 2,842 --.--K/s 09:44:54 (194.02 KB/s) - `test_param.tar.gz' saved [2842/2842] Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
I'm sorry, my mistake :-) Jua!.. this is my second stupid think. Thanks to all. Eduardo On Mon, 18 Aug 2008, Eduardo Lopez wrote: http://www.sistemasrpm.com.ar/soporte/test_param.tar.g I get a permission denied error trying to access this URL, and the same when I add a .gz I can download: http://www.sistemasrpm.com.ar/soporte/test_param.tar.gz Hehe, it's anti-robot measures. But I can circumvent that :-) ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus Yahoo! Cocina Recetas prácticas y comida saludable http://ar.mujer.yahoo.com/cocina/___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
I'm sorry. The table has a basic structure: CREATE TABLE USUARIOS ( CODUSU Char(12) NOT NULL, APENOMB Char(40) NOT NULL, PASSWOR Char(12) NOT NULL, CONSTRAINT PK_USUARIOS PRIMARY KEY (CODUSU) ); Thanks. Eduardo. - Mensaje original De: Michael Van Canneyt [EMAIL PROTECTED] Para: General mailing list lazarus@lazarus.freepascal.org Enviado: martes 19 de agosto de 2008, 4:48:16 Asunto: Re: [Lazarus] Problem working with Params in TSQLQuery On Mon, 18 Aug 2008, Eduardo Lopez wrote: Joost van der Sluis escribió: I isolate the problem doing a simple program and the problem remains. Then make a copy of this simple program and change the components to Zeos. (6.6.3-stable) and works well. I'll consider change the sqldb components for Zeos in my application as a possible solution. But the sqldb must be work (i think :-) ). Offcourse, but then we have to find the problem. Parameters do work here, also in the testsuite. What happens if you remove the 'trim' in both cases? (Without the parameter and with?) I tried and nothing happens. I prepare the sample proyect, if someone want to see it and can find what stupid thing i'm doing... ;-) http://www.sistemasrpm.com.ar/soporte/test_param.tar.g Can you please provide the CREATE statement for the table ? Without the correct table definition, it's hard to test. Michael. ¡Buscá desde tu celular! Yahoo! oneSEARCH ahora está en Claro http://ar.mobile.yahoo.com/onesearch___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
On Tue, 19 Aug 2008, Eduardo Lopez wrote: I'm sorry. The table has a basic structure: CREATE TABLE USUARIOS ( CODUSU Char(12) NOT NULL, APENOMB Char(40) NOT NULL, PASSWOR Char(12) NOT NULL, CONSTRAINT PK_USUARIOS PRIMARY KEY (CODUSU) ); Aha. This is probably your problem. Try extending the parameter value so it has the declared length by padding it with spaces. The other way is to declare the table as CREATE TABLE USUARIOS ( CODUSU VARChar(12) NOT NULL, APENOMB VarChar(40) NOT NULL, PASSWOR VarChar(12) NOT NULL, CONSTRAINT PK_USUARIOS PRIMARY KEY (CODUSU) ); Could you try this ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
try UIB + FBDataset. Is very, very good. 2008/8/18 Eduardo Lopez [EMAIL PROTECTED] 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@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
Yes!! It works now.!! My challenge is now: a) modify all my db structure or b) replace the sqldb components with zeos. Thank you very much to all!! Eduardo. On Tue, 19 Aug 2008, Eduardo Lopez wrote: I'm sorry. The table has a basic structure: CREATE TABLE USUARIOS ( CODUSU Char(12) NOT NULL, APENOMB Char(40) NOT NULL, PASSWOR Char(12) NOT NULL, CONSTRAINT PK_USUARIOS PRIMARY KEY (CODUSU) ); Aha. This is probably your problem. Try extending the parameter value so it has the declared length by padding it with spaces. The other way is to declare the table as CREATE TABLE USUARIOS ( CODUSU VARChar(12) NOT NULL, APENOMB VarChar(40) NOT NULL, PASSWOR VarChar(12) NOT NULL, CONSTRAINT PK_USUARIOS PRIMARY KEY (CODUSU) ); Could you try this ? Michael. ___ Lazarus mailing list Lazarus@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___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
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 [EMAIL PROTECTED] Para: General mailing list lazarus@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 [EMAIL PROTECTED] 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@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___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
Eduardo Lopez pisze: Yes!! It works now.!! My challenge is now: a) modify all my db structure or b) replace the sqldb components with zeos. Thank you very much to all!! Eduardo. c) write padding function :-) On Tue, 19 Aug 2008, Eduardo Lopez wrote: I'm sorry. The table has a basic structure: CREATE TABLE USUARIOS ( CODUSU Char(12) NOT NULL, APENOMB Char(40) NOT NULL, PASSWOR Char(12) NOT NULL, CONSTRAINT PK_USUARIOS PRIMARY KEY (CODUSU) ); Aha. This is probably your problem. Try extending the parameter value so it has the declared length by padding it with spaces. The other way is to declare the table as CREATE TABLE USUARIOS ( CODUSU VARChar(12) NOT NULL, APENOMB VarChar(40) NOT NULL, PASSWOR VarChar(12) NOT NULL, CONSTRAINT PK_USUARIOS PRIMARY KEY (CODUSU) ); Could you try this ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org mailto:Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus Yahoo! Cocina Recetas prácticas y comida saludable Visitá http://ar.mujer.yahoo.com/cocina/ ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
On Tue, 19 Aug 2008, Eduardo Lopez wrote: Yes!! It works now.!! My challenge is now: a) modify all my db structure or b) replace the sqldb components with zeos. Or pad your parameters. Meanwhile I think I know why the problem exists, I will consult with Joost for a test and possible solution. After we've committed a fix, you can then remove the padding function. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
On Mon, 18 Aug 2008, Eduardo Lopez wrote: 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). I have parameters working. Is the ParseSQL property set to 'True' ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
Op maandag 18-08-2008 om 09:14 uur [tijdzone +0200], schreef Michael Van Canneyt: On Mon, 18 Aug 2008, Eduardo Lopez wrote: 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). I have parameters working. Is the ParseSQL property set to 'True' ? That shoudn't make any difference. What if you use params[0].asstring := ... ? Joost ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
On Mon, 18 Aug 2008 02:01:14 -0300, Eduardo Lopez wrote: 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 first one has quotes around the data string you are comparing against, has the second one got the quotes too when it's passed to the database? -- Regards - Rodney Pont E-mail by PMMail - [EMAIL PROTECTED] really weird out of context words courtesy of PMMail's spellchecker ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
On Mon, 18 Aug 2008, Rodney Pont wrote: On Mon, 18 Aug 2008 02:01:14 -0300, Eduardo Lopez wrote: 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 first one has quotes around the data string you are comparing against, has the second one got the quotes too when it's passed to the database? You should never put the quotes manually for parameters. The engine will do so if it is required. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
Joost van der Sluis escribió: Op maandag 18-08-2008 om 09:14 uur [tijdzone +0200], schreef Michael Van Canneyt: On Mon, 18 Aug 2008, Eduardo Lopez wrote: ave parameters working. Is the ParseSQL property set to 'True' ? That shoudn't make any difference. What if you use params[0].asstring := ... ? Joost First, thanks all for yours reply. The ParseSQL has no effect. Joost, the change you suggest don't work too. I isolate the problem doing a simple program and the problem remains. Then make a copy of this simple program and change the components to Zeos. (6.6.3-stable) and works well. I'll consider change the sqldb components for Zeos in my application as a possible solution. But the sqldb must be work (i think :-) ). Thanks to all. Eduardo. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
Op maandag 18-08-2008 om 15:38 uur [tijdzone -0300], schreef Eduardo Lopez: Joost van der Sluis escribió: Op maandag 18-08-2008 om 09:14 uur [tijdzone +0200], schreef Michael Van Canneyt: On Mon, 18 Aug 2008, Eduardo Lopez wrote: ave parameters working. Is the ParseSQL property set to 'True' ? That shoudn't make any difference. What if you use params[0].asstring := ... ? Joost First, thanks all for yours reply. The ParseSQL has no effect. Joost, the change you suggest don't work too. I isolate the problem doing a simple program and the problem remains. Then make a copy of this simple program and change the components to Zeos. (6.6.3-stable) and works well. I'll consider change the sqldb components for Zeos in my application as a possible solution. But the sqldb must be work (i think :-) ). Offcourse, but then we have to find the problem. Parameters do work here, also in the testsuite. What happens if you remove the 'trim' in both cases? (Without the parameter and with?) Joost ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem working with Params in TSQLQuery
Joost van der Sluis escribió: I isolate the problem doing a simple program and the problem remains. Then make a copy of this simple program and change the components to Zeos. (6.6.3-stable) and works well. I'll consider change the sqldb components for Zeos in my application as a possible solution. But the sqldb must be work (i think :-) ). Offcourse, but then we have to find the problem. Parameters do work here, also in the testsuite. What happens if you remove the 'trim' in both cases? (Without the parameter and with?) I tried and nothing happens. I prepare the sample proyect, if someone want to see it and can find what stupid thing i'm doing... ;-) http://www.sistemasrpm.com.ar/soporte/test_param.tar.g TIA. Eduardo. Joost ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Problem working with Params in TSQLQuery
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@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus