System Error Code 1400

edited 1:52AM in FastReport Studio
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




Comments

  • edited 1:52AM
    There is no a report template (FR3 file) load into report object
    Try following 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.


Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.