Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Right Recno()
Message
De
02/11/1999 18:12:07
 
 
À
02/11/1999 16:28:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00285239
Message ID:
00285819
Vues:
20
Hi Joao,

>I get the fowling error in the valid event,
>'No database is open or set as the current database' in the line
> lcPrimaryKey = dbgetprop........ and then
>'variable lcPrimaryKey does not exist'

That means your database isn't open. Do you have a main data base for the application? Is this table apart of the database, and does this table have a primary index? If so, you need to open the database sometime before this happens. I usually open it up at the beginning of my app (OPEN DATABASE is the code) Other wise, use this (this uses the Recno() instead of a primary Key):
local lnCurWA, llReturn, lcExact, leValue, lnRecno()

with This
	lnCurWA = select()
	lcExact = set('exact')
	set exact on
	lnRecno = recno(juststem(.ControlSource))

	use (dbf(juststem(.ControlSource))) again alias EnforceUnique in 0
	select EnforceUnique

	llReturn = !seek(.Value, 'enforceunique', justext(.ControlSource)) or Recno() = lnRecno

	use
	select (lnCurWA)
	set exact &lcExact

endwith
if !llreturn
	MessageB('Value is not unique')
endif
return iif(llReturn, .T., 0)
Does this work?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform