VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Create Table From Visual Basic.

by Rajender Sharma (7 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 20th November 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Create Table From Visual Basic.

Rate Create Table From Visual Basic.



Dim db As Database
Dim tb As TableDef
Private Const MY_PATH = _
"h:\civil_raj\homes\vb_raj\raj.mdb"

Private Sub Command1_Click()
Dim db As Database
Set db = DBEngine.Workspaces(0).OpenDatabase(MY_PATH)
If List1.Text <> "" Then
db.Execute ("DROP TABLE [" & List1.Text & "]")
db.Close
List1.RemoveItem List1.ListIndex
End If
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
Set db = DBEngine.Workspaces(0).OpenDatabase(MY_PATH)
For Each tb In db.TableDefs
If Left(tb.Name, 4) <> "MSys" Then
List1.AddItem tb.Name
End If
Next
End Sub


Download this snippet    Add to My Saved Code

Create Table From Visual Basic. Comments

No comments have been posted about Create Table From Visual Basic.. Why not be the first to post a comment about Create Table From Visual Basic..

Post your comment

Subject:
Message:
0/1000 characters