Page 1 of 1

DataTypeMap

Posted: Fri 23 Nov 2012 21:49
by fonsn
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;

Re: DataTypeMap

Posted: Mon 26 Nov 2012 09:36
by AlexP
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.