[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

Failed to load database information. error when running a new crystal report

Asked by jjgarner in Databases Miscellaneous, Crystal Reports Software, Microsoft Visual Interdev

Tags: CR crystal reports vs visual studio .net crdb_query.dll

I made a duplicate of a crystal report file within our web application and changed the data that was pulled to the report by:
  -opening the report in Visual Studio 2005
  -right clicked the "Database Fields" menu item inside the "Field Explorer" box and then selected "Data Expert"
  -I then proceeded to remove the list of tables that where listed in the right Panel, labeled "Selected Tables".
  -I then selected the "Add Command" option from the left panel labeled "Available Data Sources" and moved it to the right panel.
  -I then choose to edit the command and I pasted in my SQL statement.
  -I then added the needed data to the report and went to test it out.

When I went to open the report from the web browser it gave me the error listed below:

Failed to load database information.
Details: The database DLL 'crdb_query.dll' could not be loaded.Error in File C:\WINDOWS\TEMP\jobsheet {C2E1E018-C5A3-49E1-9584-98EB3638BE10}.rpt:
Failed to load database information.

Also when I tried to open the other preexisting reports there is no data being feed to them? I'm guessing that is because I removed the listed tables that where in the "Selected Tables" Panel. I did not realize this was the data source for all the .rpt files??? I thought it only controlled the single report I was editing?

How can I get the old and new .rpt files working again?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
Dim myreport As ReportDocument = New ReportDocument
 
 
 
Dim logOnInfo As New TableLogOnInfo
Dim crTable As CrystalDecisions.CrystalReports.Engine.Table
'The crystal reports template
'myreport.Load(Server.MapPath("reports/new_jobsheet.rpt"))
myreport.Load(Server.MapPath("reports/jobsheet.rpt"))
'myreport.Load(Server.MapPath("reports/test_it2.rpt"))
 
 
For Each crTable In myreport.Database.Tables
logOnInfo = crTable.LogOnInfo
	logOnInfo.ConnectionInfo.ServerName = System.Configuration.ConfigurationManager.AppSettings("DatabaseServer")
	logOnInfo.ConnectionInfo.DatabaseName = System.Configuration.ConfigurationManager.AppSettings("Database")
	'Get the username and pwd from the web.config file
	logOnInfo.ConnectionInfo.UserID = System.Configuration.ConfigurationManager.AppSettings("db_username")
	logOnInfo.ConnectionInfo.Password = System.Configuration.ConfigurationManager.AppSettings("db_password")
 
	crTable.ApplyLogOnInfo(logOnInfo)
	crTable.Location = crTable.Name
Next crTable
 
myreport.Refresh()
Dim strexportfile As String
If m_ID <> "" Then
	strexportfile = m_ID & ".pdf"
Else
	strexportfile = "jobsheet.pdf"
End If
 
'Set the crystal reports parameter for the job numbers
myreport.SetParameterValue("jobnumber", Request.QueryString("id"))
Dim s As System.IO.MemoryStream
Try
	s = myreport.ExportToStream(ExportFormatType.PortableDocFormat)
Catch ex As Exception
	Threading.Thread.Sleep(1000)
	s = myreport.ExportToStream(ExportFormatType.PortableDocFormat)
End Try
 
myreport.Close()
myreport.Dispose()
With HttpContext.Current.Response
	.ClearContent()
	.ClearHeaders()
	.ContentType = "application/pdf"
	.AddHeader("Content-Disposition", "attachment; filename=" & strexportfile)
	Dim b(s.Length) As Byte
	s.Read(b, 0, s.Length)
	.BinaryWrite(s.ToArray)
	s.Flush()
	s.Close()
	.Flush()
	.Close()
	.End()
End With
[+][-]10/22/09 01:55 PM, ID: 25638931Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/23/09 04:44 AM, ID: 25643398Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/23/09 06:47 AM, ID: 25644354Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625