Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need a ISKeyword() function
Message
From
22/01/1999 13:39:45
 
 
To
22/01/1999 12:50:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00179052
Message ID:
00179114
Views:
19
>I need a function that tells me that a character expression is a keyword, that is, a reserved word in VFP.
>
>I allow some limited changes to table structure and indexes. I need to check if the users has entered a reserved word for either.
>
>These can cause problems with SQL statements etc.
>
>If I have to write one does anyone have a table of reserved or Keywords?

In general the keywords that SQL chokes on are not VFP keywords, but SQL keywords. You can avoid 99% of problems by makin sure fields are not SQL keywords:

FUNCTION isSQLKeyWord
tcWord
tcWord = UPPER(ALLTRIM(tcWord))

RETURN INLIST(tcWord, "SELECT", "FROM", "WHERE", "HAVING", "GROUP", "ORDER", "INTO","IN","BY","TOP","NOT","TABLE","CURSOR","ARRAY")
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform