Help - Search - Members - Calendar
Full Version: System Error Code 1400
Fast Reports forum > Fast Reports Products > FastReport Studio
RETEX
When I use Visual Basic 6 to develop to the use of customer end.

Find to that will present an information in the preview report form once in a while.

"System Error Code 1400"

Will present this information too when preview magnify,reduce or print.

Is there had any way to solve the problem?

Or has already known mi



Public Sub ReportLoad()
On Error GoTo ReportLoadErr
Dim query_obj As TfrxADOQuery
Dim database_obj As TfrxADODatabase
Set report = Nothing
Set report = CreateObject("FastReport.TfrxReport")
Set database_obj = report.FindObject("ADODatabase1")

If database_obj Is Nothing Then
MsgBox "ADO connection object 'ADODatabase1' not found"
Else
database_obj.LoginPrompt = False
database_obj.Connected = False
database_obj.ConnectionString = strConnectionString
database_obj.Connected = True
End If

' Find query object
Set query_obj = report.FindObject("ADOQuery1")
If query_obj Is Nothing Then
MsgBox "ADO query object 'ADOQuery1' not found"
Else
query_obj.Query = strQuery1
End If

' Find query object
Set query_obj = report.FindObject("ADOQuery2")
If query_obj Is Nothing Then
MsgBox "ADO query object 'ADOQuery2' not found"
Else
query_obj.Query = strQuery2
End If

' Find query object
Set query_obj = report.FindObject("ADOQuery3")
If query_obj Is Nothing Then
MsgBox "ADO query object 'ADOQuery3' not found"
Else
query_obj.Query = strQuery3
End If

Set query_obj = Nothing
Set database_obj = Nothing

report.PreviewOptions.Buttons = pb_Zoom + pb_Print + pb_NoFullScreen + pb_NoEmail + pb_Navigator + pb_NoClose
report.MainWindowHandle = frmMain.hwnd
report.ShowReport

Exit Sub

ReportLoadErr:
MsgBox Err.Number & vbCrLf & Err.Description, vbCritical + vbOKOnly, "ReportLoadError"
End Sub




alman
There is no a report template (FR3 file) load into report object
Try following code:

CODE
Public Sub ReportLoad()
On Error GoTo ReportLoadErr

Dim query1_obj As TfrxADOQuery
Dim query2_obj As TfrxADOQuery
Dim query3_obj As TfrxADOQuery

Dim database_obj As TfrxADODatabase
Set report = Nothing
Set report = CreateObject("FastReport.TfrxReport")

' This is a good place to load report template

report.LoadReportFromFile("Your_Report_Name.fr3")

Set database_obj = report.FindObject("ADODatabase1")

If database_obj Is Nothing Then
MsgBox "ADO connection object 'ADODatabase1' not found"
Else
database_obj.LoginPrompt = False
database_obj.Connected = False
database_obj.ConnectionString = strConnectionString
database_obj.Connected = True
End If

' Find query object
Set query1_obj = report.FindObject("ADOQuery1")
If query1_obj Is Nothing Then
MsgBox "ADO query object 'ADOQuery1' not found"
Else
query1_obj.Query = strQuery1
End If

' Find query object
Set query2_obj = report.FindObject("ADOQuery2")
If query2_obj Is Nothing Then
MsgBox "ADO query object 'ADOQuery2' not found"
Else
query2_obj.Query = strQuery2
End If

' Find query object
Set query3_obj = report.FindObject("ADOQuery3")
If query3_obj Is Nothing Then
MsgBox "ADO query object 'ADOQuery3' not found"
Else
query3_obj.Query = strQuery3
End If

report.PreviewOptions.Buttons = pb_Zoom + pb_Print + pb_NoFullScreen + pb_NoEmail + pb_Navigator + pb_NoClose
report.MainWindowHandle = frmMain.hwnd
report.ShowReport

Set query1_obj = Nothing
Set query2_obj = Nothing
Set query3_obj = Nothing
Set database_obj = Nothing

Exit Sub

ReportLoadErr:
MsgBox Err.Number & vbCrLf & Err.Description, vbCritical + vbOKOnly, "ReportLoadError"
End Sub



Finally, you may send a simply demo that demonstrates the problem to support@fast-report.com.


This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.