Get The Tables List From a database

Wednesday, April 29, 2009

Private Sub GetTables(ByVal sDatabaseName As String)
Try

Dim sSQL As String = "show tables in " & sDatabaseName
objCmd = New OdbcCommand(sSQL, ObjCon)
'Cmd = CN.CreateCommand
'Cmd.CommandText = sSQL

Dim oRS As Odbc.OdbcDataReader = objCmd.ExecuteReader
'Do While oRS.Read
cbotablename.Items.Add(oRS(0))
Loop
oRS.Close()


Catch ex As Exception
MsgBox(Err.Description)
End Try
End Sub

0 comments

Post a Comment