DataTypeMap

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
fonsn
Posts: 1
Joined: Fri 23 Nov 2012 21:43

DataTypeMap

Post by fonsn » Fri 23 Nov 2012 21:49

Hi,

In the code below, what is the correct order: does the DataTypeMap need to be set before connecting to the database or does it need to be set after connecting to the database? Or does it not matter at all.

Thanks in advance.

Best regards,
Fons

LiteConnectionMain.DataTypeMap.Clear;
LiteConnectionMain.DataTypeMap.AddDBTypeRule(liteInteger, ftInteger);
LiteConnectionMain.DataTypeMap.AddDBTypeRule(liteChar, ftString);
LiteConnectionMain.DataTypeMap.AddDBTypeRule(liteMoney, ftCurrency);

LiteConnectionMain.Database:= 'Z:\Test.db3';
LiteConnectionMain.Connected:= True;

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: DataTypeMap

Post by AlexP » Mon 26 Nov 2012 09:36

Hello,

The DataTypeMapping rules must be set before opening the DataSet to which you want to apply these rules. In this case, you can create rules both before and after opening connection. If the rules are applied to TLiteConnection directly, they should be set before opening connection.

Post Reply