Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
Assignment of ParamByName.Value fails to set datatype |
Fri, Dec 19 2008 2:25 AM | Permanent Link |
Magnus Rosendahl | I encountered an error when upgraded a Delphi project from D2007
(DBISAM426b3) to D2009 (DBISAM427b1). Consider the following code snippet: //Query = TDBISAMQuery //sql = SELECT * FROM T WHERE F1=:P1 AND F2=:P2 //WhereFields = array of string //WhereValues = array of Variant with Query do begin SQL.Clear; SQL.Add(sql); for i := Low(WhereFields) to High(WhereFields) do ParamByName(WhereFields[i]).Value := WhereValues[i]; Open; ... end; This code ran fine with 4.26 but gives an error in 4.27. Exception EDatabaseError 'Query: Field 'F1' is of an unknown type.' Problem is I assign a Variant to Param.Value, and the datatype is not automatically set. I could of course solve this by checking the VarType of the value to be assigned and then use the assignment function AsInteger, AsString etc. But since it worked in the previous DBISAM version I thought you might want to look at it. I suspect the error is related to the fact that variant strings are no longer varString by default but varUString. Regards, Magnus Rosendahl |
Fri, Dec 19 2008 2:17 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Magnus,
<< But since it worked in the previous DBISAM version I thought you might want to look at it. I suspect the error is related to the fact that variant strings are no longer varString by default but varUString. >> Yes, you are correct. There will be a new DBISAM build out shortly that will correct this. -- Tim Young Elevate Software www.elevatesoft.com |
Wed, Jan 7 2009 9:50 AM | Permanent Link |
Magnus Rosendahl | > << But since it worked in the previous DBISAM version I thought you might
> want to look at it. I suspect the error is related to the fact that variant > strings are no longer varString by default but varUString. >> > > Yes, you are correct. There will be a new DBISAM build out shortly that > will correct this. Thank you. Works properly in 4.27 build 2. Magnus |
This web page was last updated on Tuesday, May 14, 2024 at 07:14 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |