Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Record creation
Message
De
23/07/2008 00:03:36
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
22/07/2008 23:45:32
Muthu Vel
Sty Company
Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01333372
Message ID:
01333374
Vues:
15
>I have a table student.dbf having fileds 1.Regno, 2.name. 3.Standard.
>
>I have create a record creatrion.scx, In that I have placed two text boxes namely From, To and one command button namely OK.
>
>I have create 500 records based on the Regno field. the starting Regno is "10001".so I have entered 10001 to "from" text boxes and
>10500 to "To" text boxes and click OK command button the 500 records have created, the Message box will dispaly Record created Successfully.
>
>How to create records through coding In VisualFoxpro?

You want to create records through code, right?

Something like this, assuming you get the range (from, to) from TextBoxes in the Form.:
* The following code goes into Button.Click()
lnFrom = ThisForm.TxtFrom.Value
lnTo = ThisForm.TxtTo.Value
* Do some checking, for example, lnTo >= lnFrom, or check that the records don't already exist
local lnCounter
for lnCounter = lnFrom to lnTo
  append blank
  replace RegNo with lnCounter
next
* Show results with MessageBox() or with the "wait window ... nowait" command.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform