Info about TMSLoader components

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Sergio Bertolotti
Posts: 54
Joined: Tue 02 May 2006 12:03
Location: Italy

Info about TMSLoader components

Post by Sergio Bertolotti » Tue 15 Apr 2008 07:09

Dear Support,

I'm a register user of SDAC 4.x prof. I use last version 4.35.1.16 with Delphi 2007 prof.

I use your component TMSLoader with SQL 2005 Express edition.
In particulary method LoadFromDataset. I want to import in my table records from another table, in this case MSAccess.

I connect to access via ADO/dbGo all is OK.

The problem is :

-How can I map field from source to destination ? Is it automatically ?

With TCRBatchMove exist a property, MAPS that I can use to maps destination fields over source field, but I can't find this property in TMSLoader....

Can you explain in more details how can I use it ?

Best regards.

Sergio Bertolotti

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 15 Apr 2008 11:52

The TMSLoader component has no Mappings property like TCRBatchMove has. The LoadFromDataSet method maps fields automatically comparing field names of the source dataset and names from TMSLoader.Columns. If the TMSLoader.Columns property is empty, the method considers that all fields in the source dataset are in the destination table.

Sergio Bertolotti
Posts: 54
Joined: Tue 02 May 2006 12:03
Location: Italy

Post by Sergio Bertolotti » Tue 15 Apr 2008 12:08

Dear Antaeus,

many thank's for your answer.

If I understand correctly, I can import records with TMSLoader only if fields name of Source and Destination are identical.

If not I can't import records... It's correct ?

Why do you think to implement a property MAPS like TCRBatchMove ?

Best regards.

Sergio Bertolotti

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 15 Apr 2008 14:37

Yes, you are right. Field names of the source dataset and the destination table must be the same. You can try using a query with aliases to change field names in the source dataset:
SELECT Field1 as Field2 FROM table1

We will consider the possibility to support field mapping for the LoadFromDataset method.

Sergio Bertolotti
Posts: 54
Joined: Tue 02 May 2006 12:03
Location: Italy

Post by Sergio Bertolotti » Wed 16 Apr 2008 07:07

Dear Antaeus,

many thanks for your answer.

I hope to see field mapping in the next release of SDAC 4.X.
For me it's more useful with this possibility to map field from origin to destination.

Best regards.

Sergio Bertolotti

Post Reply