Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append via scan
Message
De
28/02/2005 04:34:44
 
 
À
28/02/2005 04:33:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 7
Database:
Oracle
Divers
Thread ID:
00991093
Message ID:
00991108
Vues:
16
Did you read my footnote? "And I was sure that we have agreed that billno shall be 1,2,3,4,5... and not 05_0001!!! Remember that you SHOW billno as 05_0001, but you store it as 1. Please don't ask me to repeat that more times."

>hi,
>i try, but still change all billno to billno =1
>
>use mstr
>local lnRecno
>lnRecno = reccount()
>Append From Dbf('temp')
>goto lnRecno + 1 && if dbf('temp') contains no records, this line will fail, so you must check that before you append in the preceding line
>scan rest && without REST, you scan all records!
>  replace w1 with thisform.text14.value, w2 with thisform.text16.value, dis with thisform.text27.value, net with thisform.text28.value
>  replace billno with val(right (thisform.text1.Value,4)), datein with date()
>endscan
>
>thanks
>
>>Sorry, replace lnRecno=recno() with lnRecno=reccount()
>>use mstr
>>local lnRecno
>>lnRecno = reccount()
>>Append From Dbf('temp')
>>goto lnRecno + 1 && if dbf('temp') contains no records, this line will fail, so you must check that before you append in the preceding line
>>scan rest && without REST, you scan all records!
>>  replace w1 with thisform.text14.value, w2 with thisform.text16.value, dis with thisform.text27.value, net with thisform.text28.value
>>  replace billno with val(right (thisform.text1.Value,4)), datein with date()
>>endscan
>>And I was sure that we have agreed that billno shall be 1,2,3,4,5... and not 05_0001!!! Remember that you SHOW billno as 05_0001, but you store it as 1. Please don't ask me to repeat that more times.
>>
>>>hi Mr.Tore
>>>thank you,
>>>i try but still change all records,and it did not add new bill as 05_0002
>>>after save.
>>>
>>> all the code under
>>>
>>>SELECT MAX(billno) from mstr INTO ARRAY laAarray
>>>thisform.text1.value=(RIGHT(STR(YEAR(mstr.datein),4),2) + '_'+RIGHT(STR(10000+mstr.billno+1,5),4))
>>>
>>>Select 1
>>> use mstr
>>>local lnRecno
>>>lnRecno = recno()
>>>Append From Dbf('temp')
>>>goto lnRecno + 1 && if dbf('temp') contains no records, this line will fail, so you must check that before you append in the preceding line
>>>scan rest && without REST, you scan all records!
>>>  replace w1 with thisform.text14.value, w2 with thisform.text16.value, dis with thisform.text27.value, net with thisform.text28.value
>>>  replace billno with val(right (thisform.text1.Value,4)), datein with date()
>>>endscan
>>>
>>>  With thisform.grid1
>>>   .recordsource = ''
>>>   Select temp
>>>   .recordsource = 'temp'
>>>   thisform.text1.SetFocus
>>>   thisform.refresh
>>>  endwith
>>>
>>>  with thisform.Grid1
>>> .Recordsource = .Recordsource
>>>endwith
>>>
>>>  ********************************************
>>>  thisform.text1.value=space(10)
>>>  thisform.text2.value=ctod("  /  /  ")
>>>  thisform.text3.value=space(10)
>>>  thisform.text4.value=space(10)
>>>  thisform.text5.value=space(10)
>>>  thisform.text6.value=0
>>>  thisform.text7.value=0
>>>  thisform.text8.value=0
>>>  thisform.text10.value=0
>>>SELECT mstr
>>>SELECT MAX(billno) from mstr INTO ARRAY laAarray
>>>thisform.text1.value=(RIGHT(STR(YEAR(mstr.datein),4),2) + '_'+RIGHT(STR(10000+laAarray[1]+1,5),4))
>>>
>>>
>>>With thisform.grid1
>>>   .recordsource = ''
>>>   Select temp
>>>   delete all
>>>   .recordsource = 'temp'
>>>   thisform.text1.SetFocus
>>>   thisform.refresh
>>>  endwith
>>>
>>>
>>>   thisform.grid1.refresh
>>>
>>>thanks
>>>
>>>>Hi Mohammed,
>>>>
>>>>I see two serious errors. After the APPEND FROM, you are changing all the records, and not only the appended records. And Insert adds new records, that is the purpose of that command! I also suggest you combine all the replace commands into fewer, this may be very important in a multiuser scenario.
>>>>use mstr
>>>>local lnRecno
>>>>lnRecno = recno()
>>>>Append From Dbf('temp')
>>>>goto lnRecno + 1 && if dbf('temp') contains no records, this line will fail, so you must check that before you append in the preceding line
>>>>scan rest && without REST, you scan all records!
>>>>  replace w1 with thisform.text14.value, w2 with thisform.text16.value, dis with thisform.text27.value, net with thisform.text28.value
>>>>  replace billno with val(right (thisform.text1.Value,4)), datein with date()
>>>>endscan
>>>>
>>>>
>>>>>hi all,
>>>>>
>>>>>i try to insert billno,datein for all records at my table as under,
>>>>>but i see the billno,and datein at the last record for my bill as
>>>>>
>>>>>item no   value .........billno  datein       total
>>>>>1         100            0       space         0
>>>>>2         250            0
>>>>>3         40             1       01/01/2005    390
>>>>>
>>>>>********************************************************
>>>>>
>>>>>i need to see at my table as
>>>>>item no   value .........billno  datein       total
>>>>>1         100            1      01/01/2005    390
>>>>>2         250            1      01/01/2005    390
>>>>>3         40             1      01/01/2005    390
>>>>>
>>>>>*********************************************************
>>>>>i try with this code under,but it change all billno and datein for all records at mytable
>>>>>
>>>>>  use mstr
>>>>>  Append From Dbf('temp')
>>>>>scan
>>>>>   replace w1 with thisform.text14.value
>>>>>  replace w2 with thisform.text16.value
>>>>> *INSERT  INTO  mstr(billno,datein) VALUES (val(right (thisform.text1.Value,4)),DATE())&& in this case it append new record but i need to insert at the same records
>>>>>  replace dis with thisform.text27.value
>>>>>  replace net with thisform.text28.value
>>>>>endscan
>>>>>
>>>>>thanks.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform