I'm trying to modifying a table name based on two textbox inputs. I have one form creating the table using OleDb so I want to use the inputted information from that form to search for the table in the database then rename it to what the use wants on the current form.
Example output From AAAAAAA_000 To BBBBBBB_111
Import ADOX
Import ADODB
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnModify.Click
Dim ADOXCatalog As New ADOX.Catalog
Dim ADOConnection As New ADODB.Connection
Dim uc As Char = "_"
ADOConnection.Open("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Users\...\Documents\Visual Studio 2012\Projects\WindowsApplication3\WindowsApplication3\timer.mdb;" & _
"Jet OLEDB:Engine Type=5;")
ADOXCatalog.ActiveConnection = ADOConnection
ADOXCatalog.Tables('" & frmOpen.TextBox1.Text & uc.ToString & frmOpen.TextBox2.Text & "').Name ='" & txtTextBox1.Text & uc.ToString & TextBox2.Text & "'
ADOXCatalog.ActiveConnection.Close()
ADOXCatalog.ActiveConnection = Nothing
Me.Close()
End Sub