'0.0' is not a valid timestamp

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
johncmolyneux
Posts: 15
Joined: Fri 26 Jun 2009 10:06

'0.0' is not a valid timestamp

Post by johncmolyneux » Fri 26 Jun 2009 13:15

Hi.

The following code produces EConvertError ''0.0' is not a valid timestamp'. Can anyone (PLEASE!!) shed some light on this???

The problem only occurs when assigning the dataset to a virtual table. It does not occur if I simply attach a DBGrid to the MSQuery.

Thanks in advance,

John.



// Start of code ---------------------------------
program TimestampError;

uses
MSAccess, VirtualTable, ActiveX;

const
CONNECTION_STRING = 'Provider=SQLOLEDB.1;' +
'Integrated Security=SSPI;' +
'Data Source=localhost;' +
'Initial Catalog=master;';

var
MSConnection: TMSConnection;
MSQuery: TMSQuery;
MSVirtualTable: TVirtualTable;
begin
CoInitialize(nil);

MSConnection := TMSConnection.Create(nil);
MSConnection.ConnectString := CONNECTION_STRING;

MSQuery := TMSQuery.Create(nil);
MSQuery.Connection := MSConnection;

MSQuery.SQL.Text := 'IF EXISTS (SELECT 1 FROM SYSOBJECTS WHERE [NAME] = ''TEST'' AND TYPE = ''U'') DROP TABLE TEST';
MSQuery.Execute;

MSQuery.SQL.Text := 'CREATE TABLE TEST(RECORD_ID INT, CREATE_DATE DATETIME DEFAULT(GETDATE()))';
MSQuery.Execute;

MSQuery.SQL.Text := 'INSERT INTO TEST (RECORD_ID) VALUES (1)';
MSQuery.Execute;

MSQuery.SQL.Text := 'SELECT * FROM TEST';
MSQuery.Open;

MSVirtualTable := TVirtualTable.Create(nil);
MSVirtualTable.Assign(MSQuery); // This line throws the exception
MSVirtualTable.Open;

MSVirtualTable.Free;
MSQuery.Free;
MSConnection.Free;

CoUninitialize;
end.

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 26 Jun 2009 14:15

I could not reproduce the problem.
Please supply me the following information:
- the exact version of SDAC. You can see it in the About sheet of TMSConnection Editor;
- the exact version of your IDE;
- the exact version of SQL server and client. You can see it in the Info sheet of TMSConnection Editor.

johncmolyneux
Posts: 15
Joined: Fri 26 Jun 2009 10:06

Post by johncmolyneux » Mon 29 Jun 2009 06:59

Hi.

SDAC version is 4.70.0.47
IDE version is 5 (build 6.18, update pack 1)
SQL Server is 8.00.0760
SQL Client is 8.10.1064
OS is Windows 2000, v5.00.2195, service pack 4

If you need any more info, just give me a shout. Thanks for looking into this for me. It's a show-stopper with this current project.

Thanks,

John.

johncmolyneux
Posts: 15
Joined: Fri 26 Jun 2009 10:06

Post by johncmolyneux » Mon 29 Jun 2009 09:23

Hi Dimon,

Thanks for looking into this for us, but I think I've tracked down the problem to some changes made to the VCL in our dev environment. We're now working to eradicate the changes as I we are TOTALLY opposed to changing the VCL in any way.

Thanks again.

John.

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 30 Jun 2009 07:04

If there is anything else I can help you with, please contact me.

Post Reply