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.
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.