Hi,
I want to be able to manipluate a recordset (such as add and delete records), without changing any data in the database so that this recordset can be used to populate a crystal report. Reading other threads and talking to other engineers, it appears that the only way to do this is to use a disconnected recordset. However, it just does not appear to work.
The code is as follows :-
RS.ActiveConnection = Nothing
RS.Save "Assets.dat"
RS.Close
RS.Open "Assets.dat", , adOpenStatic, adLockOptimistic, adCmdFile
I am then adding new records using .AddNew, however when I assign this recordset to the crystal report, oRpt (a CRAXDRT.Report) the new additions are just not being printed.
The code I am using to do this is :-
oRpt.DiscardSavedData
oRpt.Database.Tables(1).SetPrivateData 3, RS
oRpt.ReadRecords
CRViewer1.ReportSource = oRpt
CRViewer1.ViewReport
Any ideas anyone ?
Many thanks in advance
Dave Richardson
I want to be able to manipluate a recordset (such as add and delete records), without changing any data in the database so that this recordset can be used to populate a crystal report. Reading other threads and talking to other engineers, it appears that the only way to do this is to use a disconnected recordset. However, it just does not appear to work.
The code is as follows :-
RS.ActiveConnection = Nothing
RS.Save "Assets.dat"
RS.Close
RS.Open "Assets.dat", , adOpenStatic, adLockOptimistic, adCmdFile
I am then adding new records using .AddNew, however when I assign this recordset to the crystal report, oRpt (a CRAXDRT.Report) the new additions are just not being printed.
The code I am using to do this is :-
oRpt.DiscardSavedData
oRpt.Database.Tables(1).SetPrivateData 3, RS
oRpt.ReadRecords
CRViewer1.ReportSource = oRpt
CRViewer1.ViewReport
Any ideas anyone ?
Many thanks in advance
Dave Richardson