DateTime error in 3.4.6?

DateTime error in 3.4.6?

Postby glennvisma » Thu 31 Jul 2014 09:07

Hi. I'm trying to use AsDateTime in your dbExpress driver, but it doesn't seem to be working?

Code: Select all
  qry := TSQLQuery.Create(nil);
  try
    qry.SQLConnection := FSQLConnection;
    qry.SQL.Text := 'CREATE TABLE [TEST] ('
      + '  [DATETIME] datetime NOT NULL '
      + ', [NUMBER] integer NOT NULL '
      + ', [TEXT] nvarchar(30) NULL '
      + '); ';
    qry.ExecSQL;
    qry.Close;

    qry.SQL.Text := ' CREATE UNIQUE INDEX [PK_TEST] ON [TEST]([DATETIME], [NUMBER]); ';
    qry.ExecSQL;
    qry.Close;

    qry.SQL.Text := 'INSERT INTO [TEST] ([DATETIME], [NUMBER], [TEXT]) '
      + ' VALUES (:DATETIME, :NUMBER, :TEXT);';
    qry.Params[0].AsDateTime := Now;
    qry.Params[1].AsInteger := 1;
    qry.Params[2].AsString := 'Text';
    qry.ExecSQL;
    qry.Close;

  finally
    qry.Free;
  end;


When I run this code I get the error: No value for parameter 'DATETIME'
glennvisma
 
Posts: 4
Joined: Wed 06 Mar 2013 14:55

Re: DateTime error in 3.4.6?

Postby PavloP » Fri 01 Aug 2014 12:36

Please try to compose a small sample to demonstrate the problem and send it to me at email pavelp*devart*com. Also specify the exact version of dbExpress driver for SQLite and Delphi you are using.
PavloP
Devart Team
 
Posts: 149
Joined: Fri 24 Jan 2014 12:33

Re: DateTime error in 3.4.6?

Postby glennvisma » Fri 01 Aug 2014 13:51

Ok. I have sent you the code now.
glennvisma
 
Posts: 4
Joined: Wed 06 Mar 2013 14:55

Re: DateTime error in 3.4.6?

Postby PavloP » Tue 05 Aug 2014 09:28

1. Unfortunately, we still can't reproduce the problem with DateTime.

2. The reason for exception occurrence in the query called via TSQLQuery in a bundle with TClientDataset is not related to our driver. This is a DataSnap error, it occurs in the TCustomSQLDataSet.PSGetDefaultOrder method on an attempt to define the ordering of the query result (parsing of the CASE construct). This problem can be solved by setting the poRetainServerOrder option of TDataSetProvider. This should be done before using the provider. In your case, it will look like the following:
Code: Select all
  prov.Options := prov.Options + [poRetainServerOrder];
  cds.SetProvider(prov);

3. The reason for exception occurrence in the query called via TSimpleDataSet is the same as the one describe above one, but it can't be resolved in the described way, since there is no access to the internal TDataSetProvider. This is due to the fact that TSimpleDataSet is designed for simple queries: http://docwiki.embarcadero.com/RADStudio/XE5/en/Using_TSimpleDataSet
PavloP
Devart Team
 
Posts: 149
Joined: Fri 24 Jan 2014 12:33

Re: DateTime error in 3.4.6?

Postby glennvisma » Wed 06 Aug 2014 12:07

Hm... Ok
glennvisma
 
Posts: 4
Joined: Wed 06 Mar 2013 14:55


Return to dbExpress driver for SQLite