Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Index not set?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01043460
Message ID:
01043468
Vues:
7
>I keep getting an error telling me the table has no index set, but I thought by using the seek and setting the order to cshipno it wouldnt be a problem? There is probably a simple answert for this...TIA!!!
>
>SELECT a_arcadr
>GOTO top
>SEEK (ALLTRIM(thisform.combo1.Text)) ORDER cshipno
>IF FOUND()
>
> thisform.scompany.Value = company
> thisform.saddress1.Value = saddress1
> thisform.saddress2.Value = saddress2
> thisform.scity.Value = scity
> thisform.sstate.Value = sstate
> thisform.szip.Value = szip
>ELSE
> WAIT WINDOW "customer address not found"
>ENDIF


You are mixing SEEK as a command and SEEK() as a function.
A better usage would be:
SELECT a_arcadr
SET ORDER TO cshipno
IF SEEK (ALLTRIM(thisform.combo1.Text))
  thisform.scompany.Value = company
  thisform.saddress1.Value = saddress1
  thisform.saddress2.Value = saddress2
  thisform.scity.Value = scity
  thisform.sstate.Value = sstate
  thisform.szip.Value = szip
ELSE
  WAIT WINDOW "customer address not found"
ENDIF
Another issue is that you are SEEKing an ALLTRIM() of a value. That may or may not work correctly depending on settings.
It is important not to create an index (INDEX ON) on ALLTRIM() as it could produce unpredictable results.

See:
SET EXACT
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_foxhelp9/html/5ac68f23-c330-42c4-a4a3-c38f7278b22a.asp?frame=true

String and Value Comparison in Visual FoxPro
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_foxhelp9/html/31f9c8c3-414e-4930-aa7f-2239f07b19e6.asp?frame=true


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform