Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cobol and VFP
Message
 
À
30/07/1998 00:02:50
Anderson Girardi
Athenas Automação de Escritório
Porto Alegre, Brésil
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00122575
Message ID:
00122636
Vues:
14
>Thanks Craig Berntson.
>
>I know how use fopen, fread, etc...., but how i will do the importation of data?
>Do you can help me?

Anderson,
as Craig stated once you have read a record into a variable you must parse the fields from this
e.g.

RecordLength = 100 && or whatever.

hand = fopen('coboldata')
myrec = fread(hand,RecordLength)

first_name = subst(myrec,1,20)
second_name = subst(myrec,21,20)
etc...etc..
You can either create a table of the correct structure first and then use insert into tablename from memvar, or write the parsed fields to a deliimited file,
e.g.
hand2 = fcreate(outfile)

myrec = first_name +"'" + second_name + chr(13) && to add a carriage return
fwrite(hand2,myrec,len(hand2))

Regards
Pete Kane
Regards,
Peter J. Kane



Pete
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform