Hi Guys,
I've created a recordset which is saved in a txt file using following code
Private Sub Command0_Click()
Dim Conn As ADODB.Connection
Dim Rs As ADODB.Recordset
Set Conn = New ADODB.Connection
Conn.Open "DSN=movex"
Set Rs = New ADODB.Recordset
Rs.CursorLocation = adUseClient
Rs.Open "Select * from PESALES", _
Conn, _
ADODB.adOpenForwardOnly, _
ADODB.adLockBatchOptimistic
Rs.Save "J:\Power Equipment\Common\SK\db2.rs"
Set Rs.ActiveConnection = Nothing
Rs.Close
End Sub
Now is it possible to create another table or overwrite the same one using the saved recordset?
So far I've come up with following code. I don't know if I'm any close though.
Private Sub Command1_Click()
Dim Conn As ADODB.Connection
Dim Rs As ADODB.Recordset
Set Conn = New ADODB.Connection
Conn.Open "DSN=movex"
Set Rs = New ADODB.Recordset
Rs.ActiveConnection = Conn
Rs.CursorLocation = adUseClient
Rs.Open Source:="J:\Power Equipment\Common\SK\db2.rs", Options:=adCmdFile
Rs.UpdateBatch
End Sub