BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Test if field in DB exsits

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
Dolf van den Berg
Guest





PostPosted: Wed Jun 28, 2006 3:40 pm    Post subject: Test if field in DB exsits Reply with quote



Hi

Hi how can I test if a field exists in a DB. If it exists I need to execute
a query that will use the value in that field.

Thanks


Dolf
Back to top
Dennis Passmore
Guest





PostPosted: Wed Jun 28, 2006 3:54 pm    Post subject: Re: Test if field in DB exsits Reply with quote



Just execute a query using "sp_columns_ex" specifying the table and field name and it will return
all the information available about the named column. Look it up on the MsSql books online help.


Dennis Passmore



"If you cannot conceive the idea you
will never achieve the desired results"
Back to top
Edwin Walker
Guest





PostPosted: Fri Jun 30, 2006 7:50 pm    Post subject: Re: Test if field in DB exsits Reply with quote



One way you can do this, and some might say that it is not the best way, do
a select on the table and then do a FindField on that field. If FindField
returns NIL then the field does not exist.

Edwin

"Dolf van den Berg" <dolf (AT) cyberserv (DOT) co.za> wrote in message
news:44a25ca7 (AT) newsgroups (DOT) borland.com...
Quote:
Hi

Hi how can I test if a field exists in a DB. If it exists I need to
execute a query that will use the value in that field.

Thanks


Dolf
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.