Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 30th, 2003, 11:02 AM
mab mab is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 39 mab User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
VBA in Access 2000

Hi,

Can someone tell me how to check if a table exists and if it does delete it. If it doesn't exist go to next statement. I'm using VBA in Access 2000. Thank you!

Reply With Quote
  #2  
Old August 4th, 2004, 03:43 AM
sherrington sherrington is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 85 sherrington User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 4 m 52 sec
Reputation Power: 5
Check out the KILL command in help.

If it throws an error preface with

On error resume next
Kill filename
on error ........ original error handling

Reply With Quote
  #3  
Old August 4th, 2004, 07:08 AM
ineuw ineuw is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 82 ineuw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 28 sec
Reputation Power: 5
The kill command is for deleting a file on the drive and not to delete a table from the tables collection.

It's better to check the existence of the file by If Dir(filename)>"" then kill filename.

To delete a table, check the tables collection for the existence of the table and then delete it.

Same principle and without error trapping.

Reply With Quote
  #4  
Old August 4th, 2004, 03:34 PM
anir_pandit anir_pandit is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 2 anir_pandit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Red face I need a little help please

Hi im making a database in ms access as part of my dissertation project in bioinformatics.

My difficulty is that i need to translate a string into another string. for eg. i want to change a string like

ACTGTCGTCTGTATATGACCGTA

where the first three characters are to be replaced by for eg B. The point is that every triplet has a set character with which it is to be replaced. for eg, ACT will always be replaced by B, next three characters are GTC which should be replaced by P and so on....

could anyone help me out, im an beginner in this field, so much help would be much appreciated , thanks a tonne !

cheers,

anir

Reply With Quote
  #5  
Old August 4th, 2004, 07:00 PM
ineuw ineuw is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 82 ineuw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 28 sec
Reputation Power: 5
If the strings are always made up of 3 character codes then this is not a difficult problem. If it's a mix of 2 and 3 character codes then it is.

The code for 3 character conversion would be something like this.

Dim OldString as String, NewString as String, intLength As Integer, intLoop As Integer

Oldstring = "ACTGTCGTCTGTATATGACCG"

NewString = ""

intLength = Len(OldString)

For intLoop = 1 to IntLength Step 3

Select case Mid$(OldString, intLoop, 3)
Case Is = "ACT"
NewString= NewString & "B"
Case Is = "GTC"
NewString= NewString & "P"
Case Is = "TGT"
NewString= NewString & whatever . . .
End Select

Next intLoop

Reply With Quote
  #6  
Old August 6th, 2004, 08:44 AM
anir_pandit anir_pandit is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 2 anir_pandit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up Thanks !

Thank you for your help. It is always a three character code each time. I shall try it out and let you know. Thanks again for your help.


cheers,

aniruddha

Reply With Quote
  #7  
Old October 9th, 2005, 11:48 AM
bigraph bigraph is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Location: Barbados
Posts: 1 bigraph User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 57 sec
Reputation Power: 0
Send a message via MSN to bigraph Send a message via Yahoo to bigraph
Question Re-asking mab's question

Hi all. I was glad to find Mab's question in this thread because my question is the same. Unfortunately the guys who replied did not answer his/my question at all. Could someone please help?


Quote:
Originally Posted by mab
Hi,

Can someone tell me how to check if a table exists and if it does delete it. If it doesn't exist go to next statement. I'm using VBA in Access 2000. Thank you!

Reply With Quote
  #8  
Old October 11th, 2005, 09:18 AM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
Something like this?

Dim myTable As String
myTable = "NameOfTable"
If CurrentDb.TableDefs(myTable).Name > "" Then
CurrentDb.Execute "DROP TABLE [" & myTable & "]"
Else
'Add addition statement here
End If

lwells

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > VBA in Access 2000


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT