Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Databases

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,62
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Databases
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Databases - 5/29/2001 9:13:58 AM   
  Mighty

 

Posts: 11
Score: 0
Joined: 5/22/2001
From: USA
Status: offline
Is there a way to see if a certain table in a database exists?
 
 
Post #: 1
 
 Re: Databases - 5/29/2001 9:15:38 AM   
  varcesi

 

Posts: 12
Score: 0
Joined: 5/23/2001
From: Italy
Status: offline
on error resume next 'turn errors off

rs.open "SELECT top 1 FROM tableInQuestion"

if err.number <> 0 then 'see if there was an error
'apparently, the table doesn't exist
else
'apparently, the table does exist
end if

err.clear 'clear any error messages
on error goto 0 'turn errors back on

There may be a more elegant way to do it, but this would work.

(in reply to Mighty)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Databases Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts