Conversion RB7 to RB9 problems (SQLServer2000)
Hi,
We have sqlstatements that contain SQL functions like FLOOR etc in the
where clause . These functions are added to the daBuildSQLFunctionList
method.
We dynamically create an overriden TdaQueryDesigner, and use
RemObjects/DataAbstract based custom DataViews.
The first time we open an existing RB7 statement we get error messages
saying the FLOOR, GETDATE etc are not valid dates (in case of a
datetime field) . The current search criterium is replaced by a date.
Now when we add the original search criteria back everything is ok.
When we create a new sqlstatement using the QueryDesigner all is ok as
well.
What we see is that when we Load a RB7 statement into the
QueryDesigner the function daContainsSQLFunctionCall is not called. It
is called when I start to edit the search criteria, but then the old
criteria have already been replaced by a valid date (the current
date).
Is there anything we are missing here??
regards
Paul
We have sqlstatements that contain SQL functions like FLOOR etc in the
where clause . These functions are added to the daBuildSQLFunctionList
method.
We dynamically create an overriden TdaQueryDesigner, and use
RemObjects/DataAbstract based custom DataViews.
The first time we open an existing RB7 statement we get error messages
saying the FLOOR, GETDATE etc are not valid dates (in case of a
datetime field) . The current search criterium is replaced by a date.
Now when we add the original search criteria back everything is ok.
When we create a new sqlstatement using the QueryDesigner all is ok as
well.
What we see is that when we Load a RB7 statement into the
QueryDesigner the function daContainsSQLFunctionCall is not called. It
is called when I start to edit the search criteria, but then the old
criteria have already been replaced by a valid date (the current
date).
Is there anything we are missing here??
regards
Paul
This discussion has been closed.
Comments
Sorry for the delay in this response. I have been unsucessful in trying to
recreate this issue. So far I have created a report using RB 7.04 with a
DataView included that uses the FLOOR(), and GETDATE() functions in the
Select statement and in the search criteria. (FLOOR will not accept or
return a DateTime by the way). Then tried to load that template in RB 9.02.
I have been unable to create an error. Perhaps some steps I can take to
recreate this error would help me track down why the
daContainsSQLFunctionCall is not being fired in your circumstance.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
We are using RemObjects/DataAbstract.
We have our own overloaded version of the TdaQueryDesigner and
offcourse our own implementation of TdaQueryDataView etc.
This is the code we use to stream the old version into the current
version
procedure TdmPSPQueryDesigner.QdOnCreateDataView(Sender: TObject;
var DataView: TObject);
var
SQLObj : TdaSQL;
begin
SQLObj := TdaSQL.Create(self);
try
{ Set properties for SQL builder }
SQLObj.Session := TdaDASession.Create(self);
SQLObj.DatabaseName := 'FSharedConnection';
SQLObj.DatabaseType := dtMSSQLServer;
SQLObj.IsCaseSensitive := FALSE;
SQLObj.SQLType := sqSQL2;
SQLObj.LanguageIndex :=
GetEnumValue(TypeInfo(TppLanguageType),
PSPGetLanguageManagerSingleton().
CurrentLanguage.RBLanguage);
SQLObj.DataPipelineName := 'DEFAULT';
if (Assigned(SqlComponent)) then
begin
if (SqlComponent.Size > 0) then
begin
SqlComponent.ReadComponent(SQLObj);
end;
end;
DataView := TdaDADataView.Create(TComponent(Sender));
TdaDADataView(DataView).Parent := RbDataModule;
TdaDADataView(DataView).SQL.Assign(SQLObj);
finally
SQLObj.Free;
end;
Hope this helps
regards
Paul
On Tue, 29 Mar 2005 13:16:44 -0700, "Nico Cizik \(Digital Metaphors\)"