Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check for existance of column in table
Message
From
23/02/2005 05:33:14
 
 
To
23/02/2005 05:07:30
Yh Yau
Ingenuity Microsystems Sdn Bhd
Kuala Lumpur, Malaysia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00989527
Message ID:
00989540
Views:
17
>Dear all,
>How do I check whether a particular column exist in a table? Tried field() but I only know the name of the column and not the position.
>Thanks in advance.
>Yau

An alternative method to Borislav's is:
Select YourTableAlias
lnNoFields       = FCOUNT()
I                = 1
llFound          = .F.
Do while I <= 1 lnNoFields ;
   and not llFound
  If FIELD( I) = lcYourColName
      llFound    = .T.
  Else
      I          = I + 1
  EndIf
EndDo
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Reply
Map
View

Click here to load this message in the networking platform