crystal report access database path problem

R

route_coder

I am using access database to create a crystal report in VB.NET
Everything works fine when I run on my machine. But when I am
deploying it other windows machines. It is asking for database server
name and logon information. The problem which I understood from this
is that the path is hardcoded in the crystal report and the database
is in my bin folder. when I run my app on other machines it is looking
for the database in that folder and when it is not finding it, it is
prompting me to enter the database location.

Please help me how to get around this problem so that crystal report
can take database file from the application start up path rather than
hard-coding the path.

It is quite frustrating to know crystal reports hard codes the
database path
 
S

SStory

I gave up on Crystal reports with this junk because of that issue, although
if you get the latest pack it may help you.
The thing is I didn't want to have to ship that big sucker for a little app.

I suggest getting the .NET resource kit for free and using the free
Component One Subscription and their reporting tool.

It is nice, simple and flexible.

Shane
 
G

Guest

You will need to set the database location in code. Here is sample:

Dim logOnInfo As New TableLogOnInfo

' Set the connection information
OdbcConnection1.Open()
logOnInfo.ConnectionInfo.DatabaseName = OdbcConnection1.Database & ".mdb"
logOnInfo.ConnectionInfo.Password = "pwd"
OdbcConnection1.Close()

' Apply connection info. to every table in the report
For Each tbl As Table In rpt.Database.Tables
tbl.ApplyLogOnInfo(logOnInfo)
Next
 
R

route_coder

Thanks nina for your help.But I get the same database login error.
when i insert a report into a project, I create a standard report and
give the path of the database and there it is hardcoding the path.

I guess I will move to component one reporting tool and see whether it
works for me.


Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top