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.
How to use option TRIM CHAR?
Re: How to use option TRIM CHAR?
If you use TCRSQLConnection, then you should use
sqlConnection->Params->Values["TrimFixedChar"] := "True";
Otherwise,
sqlConnection->SQLConnection->SetOption(TSQLConnectionOption(103), Integer(True));
sqlConnection->Params->Values["TrimFixedChar"] := "True";
Otherwise,
sqlConnection->SQLConnection->SetOption(TSQLConnectionOption(103), Integer(True));
Re: How to use option TRIM CHAR?
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:
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
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
hey guys what is the connection option 103 in words? just tryin to find the same thing for interbase if i can