Sure thing. Also add a reference to Microsoft ADO Ext. 2.x for DDL and Security (substitute "x" with the highest version you have installed). Then do something like this:
Code:Private Sub Command1_Click() Dim i As Integer Dim cn As New ADODB.Connection Dim cat As New ADOX.Catalog cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\MyDatabase.mdb" With cat Set .ActiveConnection = cn .Tables("MyTable").Name = "MyNewTableName" End With Set cat = Nothing cn.Close Set cn = Nothing End Sub




Reply With Quote