UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Drop Table Syntax Error    
 
   
Pastor Del
post Nov 30 2010, 12:24 PM
Post#1



Posts: 329
Joined: 27-July 10



I'm trying to drop some tables from my application with the following code: CurrentDb.Execute "DROP TABLE " & strTeamTable This code works fine until the name of the table contains something like a dash (-). How do I modify this code to allow for things like dashes, apostophes, etc.?
Go to the top of the page
 
theDBguy
post Nov 30 2010, 12:29 PM
Post#2


Access Wiki and Forums Moderator
Posts: 74,460
Joined: 19-June 07
From: SunnySandyEggo


Hi,
You might try something like:
CurrentDb.Execute "DROP TABLE [" & strTeamTable & "]", dbFailOnError
(untested)
Hope that helps...
Go to the top of the page
 
Pastor Del
post Nov 30 2010, 01:48 PM
Post#3



Posts: 329
Joined: 27-July 10



Works. Thanks.
Go to the top of the page
 
theDBguy
post Nov 30 2010, 02:55 PM
Post#4


Access Wiki and Forums Moderator
Posts: 74,460
Joined: 19-June 07
From: SunnySandyEggo


Hi,
Good luck with your project.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    17th February 2019 - 02:43 AM