Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding records to a disconnected recordset

Status
Not open for further replies.

daveri

Programmer
Oct 30, 2000
6
DE
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top