Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to transfer data in a form to a dbf file?
Message
De
05/03/1998 09:35:41
 
 
À
05/03/1998 05:50:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00082514
Message ID:
00082679
Vues:
38
>>>I have built a form that allows the user to input many rows of data and I want the user to click a SAVE button after he inputted his data and they will be saved in a dbf file(for example, abc.dbf)
>>>I know how to do that if the form only allows the player input 1 record by 1 record. Use append blank and then tableupdate(.t.). But I have no idea how to do that on many records at a time. Please help.
>>
>>Power,
>>
>>You can put the table in table buffering instead of row buffering adn then all of the new records will be buffered until you issue a tableupdate or a tablerevert
>
>I think you mean if I am using a grid? But sorry I am not. In my form I have text boxes and combo boxes in a row. And I have many rows. 1 row represent 1 record in my dbf. I want to save those records in this condition. Sorry for not mentioning them clearly to you all. :P
>I know how to use buffering mode 5 for a grid but not know how to do it on the above cases. Thanks for help.

Sounds like you have a field on the screen for each piece of data. So that if each "record" has 5 fields and you are allowing the input of 10 records. On the screen you have 50 input fields.
Using this senerio define an array laInputMatrix(10,5) and bind the first input field on the screen to laInputMatrix(1,1), the second to laInputMatrix(1,2) and soforth. Then on the second "row" of fields bind field 1 to laInputMatrix(2,1) and the second field to laInputMatrix(2,2) and soforth for each "row". Then when the user presses "save" loop through the array and add a row to the table for each non-empty row in the array.
For i = 1 to 10
if not empty(laInputMatrix(i,1))
m.field1 = laInputMatrix(i,1)
m.field2 = laInputMatrix(i,2)
.
.
insert into myTable from memvar
endif
next

Hope this answers your question.
Robert
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform