Copy recordset not working (1 Viewer)

rickyfong

Registered User.
Local time
Yesterday, 22:03
Joined
Nov 25, 2010
Messages
199
Dim rsRecordset As Recordset
With DB

Set rsRecordset = .OpenRecordset("TRANSACTION where NAME = '" & TTNAME & "'", bOpenDynaset)

End With


Dim sqlStatement As String
sqlStatement = "INSERT INTO TEMPFILE1 VALUES" & rsRecordset

'
With rsRecordset

rsRecordset.MoveFirst
Do
rsRecordset.RunSQL (sqlStatement)
rsRecordset.MoveNext
Loop While Not rsRecordset.EOF

End With


The insert into not working, the error message saying that rsRecordset is not the right type, any idea?? Thanks a lot!!
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:03
Joined
Aug 30, 2003
Messages
36,126
Yeah, that's completely invalid. Why not just execute an append query using SQL that pulls from the first table?
 

Users who are viewing this thread

Top Bottom