lpjennifer
Programmer
Hi, I'm having a problem with my VB5/Seagate 7 program. It is very simple, a query is run against data in an Access db and the results are exported into a crystal report .RTF file. When there are records in recordset - everything runs seccessfully but when there are no records i get an "unable to access first record" error msg. This error only comes about when i run the .exe on an NT server.. if I run it on my PC (development) I have no issues.. with empty or not empty recordset. I believe my problem is in the setdatasource stmnt.. because the recordset i'm setting it to is empty when this stmnt runs.. does anyone know how i can just export the (already defined) "no data for this report" report?.. and one more thing.. would you know why it works ok, in any situation, when running on my dev. pc, but not the NT server! Thanks so much! Here is my code (after my if statement, if recordcount > 0):
Set oparam = rptsalesrosterChangeNONE.ParameterFields(1)
FromDate = Format(FromDate, "Short Date")
oparam.SetCurrentValue CStr(FromDate)rptsalesrosterChangeNONE.Database.SetDataSource rsReport
rptsalesrosterChangeNONE.Database.SetDataSource
Set grptReport = rptsalesrosterChangeNONE
grptReport.ExportOptions.FormatType = crEFTRichText
grptReport.ExportOptions.DestinationType = crEDTDiskFile
grptReport.ExportOptions.DiskFileName = strNewRpt
Call grptReport.Export(False)
Thanks again!
Set oparam = rptsalesrosterChangeNONE.ParameterFields(1)
FromDate = Format(FromDate, "Short Date")
oparam.SetCurrentValue CStr(FromDate)rptsalesrosterChangeNONE.Database.SetDataSource rsReport
rptsalesrosterChangeNONE.Database.SetDataSource
Set grptReport = rptsalesrosterChangeNONE
grptReport.ExportOptions.FormatType = crEFTRichText
grptReport.ExportOptions.DestinationType = crEDTDiskFile
grptReport.ExportOptions.DiskFileName = strNewRpt
Call grptReport.Export(False)
Thanks again!