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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Basic Program & Crystal Reports

Status
Not open for further replies.

opo

Programmer
Jul 30, 2001
56
US
Developed new VB program. Use Cystal Reports. The Report viewer works fine on the development PC, but not on any other. Will give message "Server has not been opened" or "Physical Database not found"
Whats going on ?????
 
Sounds like it can't connect to the database.
Is the same ODBC connection/database/path/etc available on the other PCs?
Are there any permissions issues that are different? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Here is the code where it fails. Checked the ODBC connections and it is the same on all computers.
Cur800.Database.LogOnServer "p2ssql.dll", "ServerName", "DatabaseName", "sa"
Cur800.Database.SetDataSource "DSN Name"
Cur800.DiscardSavedData

Still couldn't find answer.
 
Why are you specifying the SQL driver, when you are using ODBC?

The ODBC driver is P2Sodbc.dll. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Changed the driver message went from "Server has not been opened" to "Physical Database not found"
 
I am new to CR. The company I am working for 'sort of like' old technology. They have some VB5 applications using CR5 on NT4 machines ODBC accessing a Sybase database. As you can imagin, maintaining is a big headache as there are virtually no documentation or help files about CR. Right now, I am having the problem of LogonServer with one of the machine. It works sometimes but will fail occasionally because of the 'couldn't logon to server' error. The code to logon is,

.LogOnServer "pdsodbc.dll", strDSN, strDB, strUser, strPwd

I have checked the environments, all parameters are correct. Does anyone have any idea on it? Thanks in advance!

At the meantime, I noticed pdsodbc.dll is not available on the machine. What is it and how come it works sometimes without it? Also, where could I get help files to look into the API?

Thanks!

Land
 
Is the path to the database different within the ODBC drivers on these PCs as compared to the design PC? I have heard that this can sometimes cause this problem. Unfortunately, I am still working on a solution. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
PDSODBC is the 16 bit version, you probably want P2Sodbc if you are in a 32 bit environment. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Thanks Ken!

Regarding the ODBC path problem, they are all the same. And I don't think it is a factor here since on the working machine, it suddently stopped working now although all the configures, parameters remain same.

Landzg
 
without changing the code a working app stopped working? Does the report have saved data? That can fool you into thinking that report are connecting when they aren't.

Otherwise, the environment must have changed. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
That is exactly what is confusing me now. The application worked fine on one of the dev machine and then had quit working ever since. The exact broken point is the .LogonServer where it returned Error 20536, "Unable to log on to server". I have verified through Sybase native query tool that the ODBC and usr/pwd are all working.

This is starting to get annoying now ......

Landzg
 
and nothing else in the environment has changed? It wouldn't hurt to run that error through the CD knowledge base. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
One more thing. Any idea where I could get the help file for these API calls?

Many thanks!

Landzg
 
Did you look in the developer's help? It comes with the V8 Developer Edition of CR. I don't think there is another place to get the help file. Crystal's web site has lots of documentation that you can download. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
the value/range you are adding has already existed

the VGRamo = 1
the VGPoliza = "010.6579"
the VGSecren = 1

Set report = crxApplication.OpenReport("D:\VB-dir\jimfor\Resumen de Seguros.rpt")
report.ParameterFields(1).AddCurrentValue (VGRamo)
report.ParameterFields(2).AddCurrentValue (VGPoliza)
report.ParameterFields(3).AddCurrentValue (VGSecRen)

CRViewer1.ReportSource = report
CRViewer1.ViewReport
 
alejandr,

If this is a question, please post it as a new question, not a response to this thread. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top