zwieback89
Programmer
I get the following error:
CRAXDRT Error Ocurred on Server - 2147192179: Error detected by Database DLL.
I pass the PatientID from another form into this page that instantiates the Report object and then also pass the userID and the password to open the report and the subreports that this main report holds. When the report opens, I get the above error.
Please tell me what could I be missing.
Hope to hear a reply soon.
Regards, Padmaja.
----------------------------------------------------------------
The way I pass the parameter and open the reports and subreports are as follows:
<%
' This line creates a string variable called reportname that we will use to pass
' the Crystal Report filename (.rpt file) to the OpenReport method contained in
' the AlwaysRequiredSteps.asp.
'reportname = "Web_Kardex.rpt"
reportname = "web_kardex_test.rpt"
' ALWAYS REQUIRED STEPS
' Include the file AlwaysRequiredSteps.asp which contains the code for steps:
' - create the application object
' - create the report object
' - open the report
%>
<!-- #include file="AlwaysRequiredSteps.asp" -->
<%
%>
<!--#include file="Database/DBConnection.asp" -->
<%
'Logon to the main report - Kardex.rpt
'set crtable = session("oRpt".Database.Tables.Item(1)
'crtable.SetLogonInfo "Pubs Sample Database", "pubs", cstr(userid), cstr(password)
'Logon to the sub-reports using the SetlogonInfo method.
'Create a reference to the tables collection of the main report
Set mainReportTableCollection = Session("oRpt".Database.Tables
For Each Table in mainReportTableCollection
Table.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'Create reference to the subreport object by opening the subreport
'by using its name as specified in the report designer.
'1st subreport = web_Emergency_Contacts.rpt
Set subReportOne = session("oRpt".OpenSubReport("web_Emergency_Contacts"
Set subReportOneTablesCollection = subReportOne.Database.Tables
'Provide the logon credentials for the subreport
For Each Table in subReportOneTablesCollection
Table.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'-----------------------------------------------------------------------------
'Create a reference to the subreport object by opening the subreport
'by using the name as specified in the report designer.
'2nd subreport = web_allergies.rpt
Set subReportTwo = session("oRpt".OpenSubReport("web_allergies"
Set subReportTwoTablesCollection = subReportTwo.Database.Tables
'Provide the logon credentials for the subreport
For Each Table in subReportTwoTablesCollection
subReportTwo.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'-------------------------------------------------------------------------------
'Create a reference to the subreport object by opening the subreport
'by using the name as specified in the report designer.
'3rd subreport = web_Renal_Care_Teams.rpt
Set subReportThree = session("oRpt".OpenSubReport("web_Renal_Care_Teams"
Set subReportThreeTablesCollection = subReportThree.Database.Tables
'Provide the logon credentials for the subreport
For Each Table in subReportThreeTablesCollection
subReportThree.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'---------------------------------------------------------------------------------
'Create a reference to the subreport object by opening the subreport
'by using the name as specified in the report designer.
'4th subreport = web_Renal_Access.rpt
Set subReportFour = session("oRpt".OpenSubReport("web_Renal_Care_Teams"
Set subReportFourTablesCollection = subReportFour.Database.Tables
'Provide the logon credentials for the subreport
For Each Table in subReportFourTablesCollection
subReportFour.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'----------------------------------------------------------------------------------
'Create a reference to the subreport object by opening the subreport
'by using the name as specified in the report designer.
'5th subreport = web_HD_Orders.rpt
Set subReportFive = session("oRpt".OpenSubReport("web_HD_Orders"
Set subReportFiveTablesCollection = subReportFive.Database.Tables
'Provide the logon credentials for the subreport
For Each Table in subReportFiveTablesCollection
subReportFive.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'----------------------------------------------------------------------------------
'Create a reference to the subreport object by opening the subreport
'by using the name as specified in the report designer.
'6th subreport = web_Test_Orders.rpt
Set subReportSix = session("oRpt".OpenSubReport("web_Test_Orders"
Set subReportSixTablesCollection = subReportSix.Database.Tables
'Provide the logon credentials for the subreport
For Each Table in subReportSixTablesCollection
subReportSix.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'-----------------------------------------------------------------------------------
'Create a reference to the subreport object by opening the subreport
'by using the name as specified in the report designer.
'7th subreport = web_Medication_Orders.rpt
Set subReportSeven = session("oRpt".OpenSubReport("web_Medication_Orders"
Set subReportSevenTablesCollection = subReportSeven.Database.Tables
'Provide the logon credentials for the subreport
For Each Table in subReportSevenTablesCollection
subReportSeven.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'-----------------------------------------------------------------------------------
'Create a reference to the subreport object by opening the subreport
'by using the name as specified in the report designer.
'8th subreport = web_Problem_List.rpt
Set subReportEight = session("oRpt".OpenSubReport("web_Problem_List"
Set subReportEightTablesCollection = subReportEight.Database.Tables
'Provide the logon credentials for the subreport
For Each Table in subReportEightTablesCollection
subReportEight.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'-----------------------------------------------------------------------------------
'The following section shows setting the Title ID.
'THe main report and the subreport should show the information for this Patient ID
'But the parameter ?PatientID exist only in the main report and not in the sub reports.
'All the reports are linked to the main report by means of the fields have a relationship
'with the field in the table of the main report.
'Request for variables.
'stPatientID = Request.querystring("ID"
stPatientID = Request.Form("PatientID"
Session("oRpt".ParameterFields.GetItemByName("PatientID".AddCurrentValue(Cdbl(stPatientID))
' MORE ALWAYS REQUIRED STEPS
' Include the file MoreRequiredSteps.asp which contains the code for the steps:
' - retreive the records
' - create the page engine
' - create the smart viewer and point it to rptserver.asp
%>
<!-- #include file="MoreRequiredSteps.asp" -->
<%
' INSTANTIATE THE REPORT VIEWER
%>
<!-- #include file="SmartViewerActiveX.asp" -->
CRAXDRT Error Ocurred on Server - 2147192179: Error detected by Database DLL.
I pass the PatientID from another form into this page that instantiates the Report object and then also pass the userID and the password to open the report and the subreports that this main report holds. When the report opens, I get the above error.
Please tell me what could I be missing.
Hope to hear a reply soon.
Regards, Padmaja.
----------------------------------------------------------------
The way I pass the parameter and open the reports and subreports are as follows:
<%
' This line creates a string variable called reportname that we will use to pass
' the Crystal Report filename (.rpt file) to the OpenReport method contained in
' the AlwaysRequiredSteps.asp.
'reportname = "Web_Kardex.rpt"
reportname = "web_kardex_test.rpt"
' ALWAYS REQUIRED STEPS
' Include the file AlwaysRequiredSteps.asp which contains the code for steps:
' - create the application object
' - create the report object
' - open the report
%>
<!-- #include file="AlwaysRequiredSteps.asp" -->
<%
%>
<!--#include file="Database/DBConnection.asp" -->
<%
'Logon to the main report - Kardex.rpt
'set crtable = session("oRpt".Database.Tables.Item(1)
'crtable.SetLogonInfo "Pubs Sample Database", "pubs", cstr(userid), cstr(password)
'Logon to the sub-reports using the SetlogonInfo method.
'Create a reference to the tables collection of the main report
Set mainReportTableCollection = Session("oRpt".Database.Tables
For Each Table in mainReportTableCollection
Table.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'Create reference to the subreport object by opening the subreport
'by using its name as specified in the report designer.
'1st subreport = web_Emergency_Contacts.rpt
Set subReportOne = session("oRpt".OpenSubReport("web_Emergency_Contacts"
Set subReportOneTablesCollection = subReportOne.Database.Tables
'Provide the logon credentials for the subreport
For Each Table in subReportOneTablesCollection
Table.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'-----------------------------------------------------------------------------
'Create a reference to the subreport object by opening the subreport
'by using the name as specified in the report designer.
'2nd subreport = web_allergies.rpt
Set subReportTwo = session("oRpt".OpenSubReport("web_allergies"
Set subReportTwoTablesCollection = subReportTwo.Database.Tables
'Provide the logon credentials for the subreport
For Each Table in subReportTwoTablesCollection
subReportTwo.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'-------------------------------------------------------------------------------
'Create a reference to the subreport object by opening the subreport
'by using the name as specified in the report designer.
'3rd subreport = web_Renal_Care_Teams.rpt
Set subReportThree = session("oRpt".OpenSubReport("web_Renal_Care_Teams"
Set subReportThreeTablesCollection = subReportThree.Database.Tables
'Provide the logon credentials for the subreport
For Each Table in subReportThreeTablesCollection
subReportThree.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'---------------------------------------------------------------------------------
'Create a reference to the subreport object by opening the subreport
'by using the name as specified in the report designer.
'4th subreport = web_Renal_Access.rpt
Set subReportFour = session("oRpt".OpenSubReport("web_Renal_Care_Teams"
Set subReportFourTablesCollection = subReportFour.Database.Tables
'Provide the logon credentials for the subreport
For Each Table in subReportFourTablesCollection
subReportFour.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'----------------------------------------------------------------------------------
'Create a reference to the subreport object by opening the subreport
'by using the name as specified in the report designer.
'5th subreport = web_HD_Orders.rpt
Set subReportFive = session("oRpt".OpenSubReport("web_HD_Orders"
Set subReportFiveTablesCollection = subReportFive.Database.Tables
'Provide the logon credentials for the subreport
For Each Table in subReportFiveTablesCollection
subReportFive.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'----------------------------------------------------------------------------------
'Create a reference to the subreport object by opening the subreport
'by using the name as specified in the report designer.
'6th subreport = web_Test_Orders.rpt
Set subReportSix = session("oRpt".OpenSubReport("web_Test_Orders"
Set subReportSixTablesCollection = subReportSix.Database.Tables
'Provide the logon credentials for the subreport
For Each Table in subReportSixTablesCollection
subReportSix.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'-----------------------------------------------------------------------------------
'Create a reference to the subreport object by opening the subreport
'by using the name as specified in the report designer.
'7th subreport = web_Medication_Orders.rpt
Set subReportSeven = session("oRpt".OpenSubReport("web_Medication_Orders"
Set subReportSevenTablesCollection = subReportSeven.Database.Tables
'Provide the logon credentials for the subreport
For Each Table in subReportSevenTablesCollection
subReportSeven.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'-----------------------------------------------------------------------------------
'Create a reference to the subreport object by opening the subreport
'by using the name as specified in the report designer.
'8th subreport = web_Problem_List.rpt
Set subReportEight = session("oRpt".OpenSubReport("web_Problem_List"
Set subReportEightTablesCollection = subReportEight.Database.Tables
'Provide the logon credentials for the subreport
For Each Table in subReportEightTablesCollection
subReportEight.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(stUserID), cstr(stPassword)
Next
'-----------------------------------------------------------------------------------
'The following section shows setting the Title ID.
'THe main report and the subreport should show the information for this Patient ID
'But the parameter ?PatientID exist only in the main report and not in the sub reports.
'All the reports are linked to the main report by means of the fields have a relationship
'with the field in the table of the main report.
'Request for variables.
'stPatientID = Request.querystring("ID"
stPatientID = Request.Form("PatientID"
Session("oRpt".ParameterFields.GetItemByName("PatientID".AddCurrentValue(Cdbl(stPatientID))
' MORE ALWAYS REQUIRED STEPS
' Include the file MoreRequiredSteps.asp which contains the code for the steps:
' - retreive the records
' - create the page engine
' - create the smart viewer and point it to rptserver.asp
%>
<!-- #include file="MoreRequiredSteps.asp" -->
<%
' INSTANTIATE THE REPORT VIEWER
%>
<!-- #include file="SmartViewerActiveX.asp" -->