Page 1 of 1

How to use option TRIM CHAR?

Posted: Mon 03 Jan 2005 14:38
by mgraziosi
I'm using version 1.86 of dbExpress driver with C++ Builder 6.

I read in the revision history that an option to automatically trim trailing chars from CHAR fields is supported. However, I couldn't find any help on how to use thi option. I tried, before connecting, both of these:
sqlConnection->Params->Add("TRIM CHAR=1");
sqlConnection->Params->Add("TRIM CHAR=true");

However, none have worked.

I did also read, in README, about a SetOption() method in TSQLConnection. However, at least in C++, I wasn't able to find any method, oon TSQLCOnnection, named SetOption().

Thanks in advance for any help.

Re: How to use option TRIM CHAR?

Posted: Wed 05 Jan 2005 09:57
by Ikar
If you use TCRSQLConnection, then you should use

sqlConnection->Params->Values["TrimFixedChar"] := "True";

Otherwise,

sqlConnection->SQLConnection->SetOption(TSQLConnectionOption(103), Integer(True));

Re: How to use option TRIM CHAR?

Posted: Sat 08 Jan 2005 18:39
by mgraziosi
It worked, thanks very much. I tried it with BCB 6 and I had no problem.

I'd only add a note which might maybe helpful to someone reading this newsgroup in the future: the Connection must be opened before issuing the above command, otherwise the program crashes. Thus, the safe way to set the automatiic TRIM of chars is:

Code: Select all

sqlConnection->Connected = true;
sqlConnection->SQLConnection->SetOption(TSQLConnectionOption(103),
        Integer(True));

for interbase

Posted: Tue 03 May 2005 04:00
by flat
hey guys nice code there just wondering where ya can find that information i have a app same thing that works great for my sql server database but i also have a interbase database i need to support just wondering where that information on set option can be found ( couldnt find past TSQLConnectionOption(20)

103 in words

Posted: Wed 04 May 2005 00:12
by Flat
hey guys what is the connection option 103 in words? just tryin to find the same thing for interbase if i can

Posted: Wed 04 May 2005 10:57
by Ikar
We don't dbExpress driver with Interbase support.