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

connecting to a secure sql database 1

Status
Not open for further replies.

viorica

Programmer
Apr 6, 2001
5
US
I've created my crystal report and added it to my vbapp. When I run my vb app, it prompts me for the date parameter which is in my crystal report. However, Once I enter the date, I get an error " server has not been opened."
Could somebody pleez give me the syntax to open the database . Thank you much
 
Hey Viorica, how's it going?

I just actually completed coding on a VB app that does exactly what you're trying to do. I need some extra info from you though before I can help further:
1.Are you using ODBC or OLE DB to connect to the server?
2.Are you viewing the report within the VB app, or just
allowing the user to print it. If you are viewing
it, then...
3.Are you using the RDC (report designer component),
Automation Server, Direct X, or hybrid to display the
report in the app?

Let me know, and we'll take it from there.

Talk later,

Jack
 
It would be wise to ensure that the client machine has all the required DLL's for accessing the appropriate database (see the RunTime.hlp file in the Seagate Software folder for full list) - this will include things like 'p2sodbc.dll'. One other fact may be the authority to the database itself (and its location from the client machine). This will include ensuring that the access to the database (I use 'SetLogOnInfo' for the database tables in the report through Delphi) is correct - passing parameters of the server-name, database-name, user-name and password. If you do not have these set in the report then you will be unable to access the data. Similarly if the location of the database is different to the machine on which the report was developed you may face a problem. I use the syntax through Delphi and set the location of the database tables as used in the report - indicating the database-name.table-name (in the case of SQL Server) or setting the full path when accessing Sage data for instance.
Hope this leads you on the way to resolving your problems ...
Steve
 
Thanks for the assistance Jack.
I am using OLE DB to connect to the server.
I would like the user to print the report but currently, I am using the RDC to view the report just to make sure it's doing what it's supposed to be doing.
Any ideas or recommendations would be greatly appreciated.


 
No problem,

I just need one more piece of info: what sort of db are you connecting to? My app can do both Access and SQL Server, and I got those errors too and it was a driver issue. Let me know how you're connecting, and I can give you the related sample code that I use.

Jack
 
OK, here's what I have in my code:
I create an instance of a CRAXDRT.Application and .Report

I then assign the report datasource
Report.Database.SetDataSource = ("Provider=SQLOLEDB",Password...etc)

I then have a loop that goes through each table via the
Report.Database.Tables(index)
and set the .setlogoninfo and .settablelocation

Once I've done that, I just show it in the viewer.

The way i was trying to do it before was by using the p2ssql.dll (or somethign like that) but it would never work, and I'd get wanky error messages like the one you did. Since I've switched to this method, I havn't had any problems (unless they were report-related).

Let me know if this helps and if there's anythign else I can do

Jack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top