469,957 Members | 2,579 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,957 developers. It's quick & easy.

crystal report access database path problem

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
Nov 20 '05 #1
3 10808
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

"route_coder" <ca**@saai-svc.com> wrote in message
news:95**************************@posting.google.c om...
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

Nov 20 '05 #2
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

"route_coder" wrote:
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

Nov 20 '05 #3
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

nina98765 <ni*******@discussions.microsoft.com> wrote in message news:<CB**********************************@microso ft.com>...
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

"route_coder" wrote:
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

Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Chuck Yeager via DotNetMonster.com | last post: by
reply views Thread by Gurmukh | last post: by
reply views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.