Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Wizard like interface for importing Address Book
Message
De
02/05/2007 08:16:32
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01221656
Message ID:
01221743
Vues:
19
This message has been marked as a message which has helped to the initial question of the thread.
>>>Hi everybody,
>>>
>>>Just thought I'd ask here if something already exists before re-inventing the wheel.
>>>
>>>I need to import Novell Address Book into my Users table. I exported the book into .NAB file (comma-delimited) and I can proceed from there assuming some predefined format, but may be there is something in Downloads that has GUI for doing this operation and matching field names, etc. VFP Import Wizard doesn't seem like a good idea here.
>>>
>>>Thanks a lot in advance.
>>
>>FoxyClasses.
>>Cetin
>
>Cetin,
>
>I browsed through the Importer class sample on your website, looks very nice. One question is not clear from the description, though - do I have to map all text file columns to table fields or I can map just few of them if, say, text file has more columns than the table? Also does this mapping get saved, so it can be re-used the next time?
>
>Thanks again.

It has code free part and code support part. You have control over what gets into your table really, how (ie: you can get a single text file and parse into multiple tables), duplicates check etc. and displays the import results. It doesn't directly import into a table but into a cursor, and lets you control rest (the hard part of a text file import is to create a compatible cursor, it does that, rest might be as easy as 'append from' or complex like getting text file for a multijoin view and parsing into multiple tables). You can even do multitable imports with no view in sight (cursor structure you choose).
Code free part handles, file type, field mappings, text to code conversions (ie: in text file it's "Beverages", in your table is an enumeration got from a lookup table), record selections, mapping save/restore. In our real world usage it even has a recorder that saves all the parameters and does the import as a scheduled task.

Summarized for your question:
-Yes you can map all or few of them and in any order. You as a developer specify which fields are required at least, which combination of fields define a 'unique' record for dupe check.
User need to map the required columns at the very least (marked yellow).
Plus if it's a CSV then you may not need any mapping. Plus it supports 'fixed' value during import (ie: if column X is not in text file but needs to be say "MyText" for all records it could simply be written there instead of a column mapping).
-Mapping gets saved. It's saved to a local Mappings.dbf file. Also in our real world usage it's saved as an XML as part of the 'recorder' parameters.

PS: The thing you saw in sample is relatively older version.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform