0

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
2
Contributors
1
Reply
2
Views
11 Years
Discussion Span
Last Post by saipavan
0

Hi i have a doubt am new to dis field.can any one help me wit dis
CreateRecordSet(ConnectionString as string, SelectSQLString as String, objRecordSet as RecordSetObject) as Boolean

7. CloseRecordSet(ConnectionString as string, objRecordSet as RecordSetObject) as boolean
give me simple program

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.