For testing purposes I need to know how to create a table based upon another table, including all the connection coding.
strSQL= "SELECT * INTO Table2 FROM Table1"
Thanks.
Example: When I run this script I get an error message: "Could not Use ";. File already in use"
Sub SQL()
Dim CurConn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Set CurDB = CurrentDb
Set CurConn = New ADODB.Connection
With CurConn
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " & CurDB.Name
.Open
End With
Set rst = New ADODB.Recordset
rst.CursorType = adOpenDynamic
rst.LockType = adLockOptimistic
Set rst = dbs.OpenRecordset("SELECT * FROM vm200501", dbOpenDynaset)
rst.Update
rst.Close
End Sub
Last edited: