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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to Open Database

Status
Not open for further replies.

33216CLC

Programmer
Aug 17, 2000
173
BS
I am able to run reports from my Development Machine fine. However, one of my clients is getting the Unable to Open Database (20533) with one of these reports. My Program is written in VB6; Database is an Access database; I use crystal reports engine for my reports. To correct the problem, I opened the report and verified the database. After doing this, opened the program and attempted to run the report again. I got the error again, but when I chose the option the second time, the report came up fine. This happened consecutively. I would get the error on the first try, but not on the second. Again on the third try, but not on the fourth.

NB.

1. Report has a subreport.
2. Client's system runs on Windos NT 4.0, using Office 2000
3. Here is the code I used to run report:

rptEE.DataFiles(0) = MyDbPath
rptEE.ReportFileName = MyAppPath + "newcheck.rpt"
rptEE.Destination = crptToWindow
rptEE.Connect = g_sRptConnect
If ReportName = CHEQUE Then
rptEE.SubreportToChange = "stub2"
rptEE.Connect = g_sRptConnect
End If
rptEE.Action = 1
rptEE.Reset

Thanks for any help.
 
A couple of things to check. Do you have save data with report unchecked in the file menu and verify on every print checked in the database menu in crystal reports? If you do and this error is happening every other time you could add something like

Code:
On Error GoTo CRError 
Retry: 
'your print report code here


'Put this at the end of the sub. 
CRError: 
'Check the Err.Number against the error number you expect to
'get every other time, If that is the error 
GoTo Retry
Ruairi

Could your manufacturing facility benefit from real time process monitoring? Would you like your employees to be able to see up to the minute goal and actual production?
For innovative, low cost solutions check out my website.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top