|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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! |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
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 |
|
#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 |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
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:
|
|
#8
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > VBA in Access 2000 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|