Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB with Crystal to SQL Server

Status
Not open for further replies.

Jill50

Programmer
Apr 11, 2001
21
US
We have a VB project which serves as a front end to run 2 Crystal Reports. The main form has 2 buttons - one for each report and an exit button. The reports were developed in Crystal 8.5 and brought into the VB project via the RDC added component, so each report has a form dedicated to it that includes the CRViewer and code to pass the logon parameters. When a report button is selected, a connection object is created and opened to connect to a SQL Server database and then the appropriate CRViewer form is loaded and the Crystal report parameter screen appears. At least it does on developer's machines that have VB 6, Crystal 8.5, and SQL Enterprise Manager loaded on them. However, on the client's machine that has a VB runtime and a Crystal runtime installed, the VB project executes and the form comes up, but when the Crystal Report viewer form loads, it gives the error message "Physical Database Not Found". Are there other components required on the client that would allow this to work?
Thanks in advance for any info!
 
"it gives the error message "Physical Database Not Found". "

This sounds like the report can't find the database. Check your paths and locations and make sure that the report can find the database. If you are hard coding the db location then remeber that it has to be in that exact location on every machine. Thanks and Good Luck!

zemp
 
The Physical Database not Found error is more or less a catch-all error message. Not being able to find the database is one cause as well as outdated or missing dlls on the client machine. The VB6 Package and Deployment Wizard uses the Crystal Print Engine dependency file (crpe32.dep) to gather the appropriate DLLs. In Crystal 8.5, you must specify which database DLLs you want to distribute by editing the crpe32.dep file and removing the semicolons in front of the item to distribute (as well as renumbering the "Usesxx=..." Like:

; Uses?=..\crystal\p2LODBC.DLL

so that it reads (assuming the previous item was Uses48)

Uses49=..\crystal\p2LODBC.DLL


I've pretty much quit letting Crystal Reports connect to SQL Server for data and started creating an ADO Recordset in code with the data I want to present through the report and setting it as the report database source:


Dim strSQL as String
Dim rpt as new CrystalReport1
strSQL = "exec sp_CrystalReport1_info "
rs.Open strSQL, <Your connection/logon info here>
If Not rs.EOF Then
rpt.Database.SetDataSource rs
CRViewer1.ReportSource = rpt
CRViewer1.ViewReport
CRViewer1.Zoom (75)
CRViewer1.EnableRefreshButton = True
Set rs = Nothing
else
Msgbox (&quot;No data for report&quot;)
End if



Mark
 
Has the machine with only the runtime version got rights to the database, what authentication is used??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top