Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Alen() how to insert record?
Message
De
27/09/2004 10:00:20
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00946234
Message ID:
00946240
Vues:
14
>I loading an array to be used in a lookup/drop down list, but I need to insert a record into the array for a blank record for "unselecting" a value. The code below ends up replacing the first record with my blank record instead of inserting. Wondering if someone can point out my error.
>
>Thanks
>
>
>IF SQLEXEC(gnConnHandle,[exec dbo.lu_surgeon],"curAssist") < 1
>	***************************************************************
>	* No records for lookup, load a default blank value
>	***************************************************************
>	PUBLIC ARRAY laAssist[1,3]
>	laAssists[1,1]=[]
>	laAssists[1,2]=""
>	laAssists[1,3]=0
>ELSE
>	PUBLIC ARRAY laAssists[1,3]
>	SELECT ALLTRIM(lastname)+[, ]+ALLTRIM(firstName),specdesc,coperid from curassist INTO ARRAY laAssists
>	**********************************************************************
>	* Redimension the array to have an extra record for a zero/blank value
>	**********************************************************************
>	DIMENSION laAssist[RECCOUNT("curassist")+1,3]
>	**********************************************************************
>	* Insert the blank/zero value into the array
>	**********************************************************************
>	AINS(laAssist,1)
>	laAssists[1,1]=[]	&& Last,First Name
>	laAssists[1,2]=""	&& Speciality
>	laAssists[1,3]=0	&& Personnel ID
>ENDIF
>
SQLEXEC(gnConnHandle,[exec dbo.lu_surgeon],"curAssist")

.RowSourceType=3
.RowSource = 'select LastFirst, Specialty, PerID from curAssist'+;
'union'+;
'select "--Not Specified--" as LastFirst, "" as Specialty, 0 as PerID from curAssist'+;
'into cursor crsLst'

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
Répondre
Fil
Voir

Click here to load this message in the networking platform