Hi there

There are several ways of doing this but I've found that this work for me
most of the time.

I use the TADOConnection.GetTableNames(tables) where tables is of type
tstringlist then I use tstringlist.indexof('tablename') to see if its there
for example


Var
  Tables : tstringlist;
Begin
  Tables:=tstringlist.create;

  Adoconnection1.gettablenames(tables);
  If tables.indexof('mytable')>0 then
  Begin
    // table exists
  End
  Else
  Begin
    // whatever if table doesn't exist
  End

  Tables.free;
End

Jangita.
http://www.jangita.com
mailto:[EMAIL PROTECTED]
 

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Nighty
Sent: 07 December 2005 4:28 p
To: [email protected]
Subject: [delphi-en] ms access check if table exists

I'm using MS Access, and I have to test by code any
kind(sql or delphi) if a table exists in the database.
Can you make a function that will return true or false
depending on the existance of the table:string in the
database connected to tado1:tadoconnection?



                
__________________________________________ 
Yahoo! DSL - Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 




-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links



 





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to