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

Run-time error 20533 "unable to open db"

Status
Not open for further replies.

Lorski

Programmer
Dec 28, 2000
12
US
Thru VB I clear out a database then import a text file in Access '97... here's the import:

Private Sub cmdImport
Set FSYS = CreateObject("Scripting.FileSystemObject")
Set F = FSYS.GetFile(FileLoc + "textfile.txt")
Set TStream = F.OpenAsTextStream ForReading,TristateUseDefault)

Do While TStream.AtEndOfStream = False
DoEvents
Adodc1.Recordset.AddNew
TS = TStream.ReadLine
Adodc1.Recordset.Fields("OneLine") = TS
Adodc1.Recordset.Update
Loop
Adodc1.Recordset.Close
EndSub

Next I want to print the database through Crystal Reports.
Here's what I'm using for that:

SetAttr (FileLoc + "Report1.rpt"), vbNormal
CrystalReport1.DataFiles(0) = (FileLoc + "TestData.mdb")
CrystalReport1.PrintReport

When walking it through, it gives me the error 20533.
Upon running the application... it sends the reports to the printer...(I can actually see the jobs in the que) but somehow the print jobs are canceled...then I get an "illegal operation" error when I close the window. Details show: "VB6 caused an invalid page fault in CRYSTL32.OCX"

I can't seem to find any information regarding how to close the db connection...opened as "OpenAsTextStream". Everything works fine... up to Crystal needing the database.

Thanks in advance.

 
Forgot to tell you, I'm using VB6.0 and Crystal 8.0.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top