Help crystal report after conversion

dicky18

Member
Joined
Sep 22, 2005
Messages
23
Location
bangkok
Programming Experience
Beginner
Hello there i recently converted a project from vs.net 2003 to 2005 and i had reports in the projects which i converted from crystal report 9 to XI
when i run my application(vb.net) i got logon failed after asking me for user name and password and my database path is ./Database.mdb which i realized thats its looking for the database in the temp folder in local settings it worked when i put database there but i want my database in my bin folder so what could be the path when so i can use this application on other machines.
Thx in advance
 
Application.StartupPath gets the path for the executable file that started the application, not including the executable name.
 
my code

thanks for the reply thats how im loading sorry im new it will be great if u have a sample code thx


Private
Sub PurchaseOrderReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.CrystalReportViewer1.ReportSource = ".\POReportPrint.rpt"
End Sub
 
What you do now with the "." means current directory, but current directory changes all the time, so I understand what you mean by "loading sorry" ;). So instead you use Application.StartupPath. See what this tells you:
VB.NET:
MsgBox(Application.StartupPath)
 
startup path

my startup path is the bin folder of my project
mydocuments\visual 2005\projects\karian\bin

and my database is there but i realized that in my crystal report the database path changed automatically to the temp folder after i converted from 2003 to 2005
is there a way to fix that?
thx
 
Can't you specify to CR that the database is in application startup path when you set the ReportSource?
 
i dont know what you mean how can do thatwell whats really going on is in the database location of all the reports changed to the temp folder do i have to redo all connections sorry im kinda new to CR
thx
 
I don't understand what you're trying to communicate, but my idea was to use Application.StartupPath to specify the application startup path for CR report source instead of your "." current directory, which incidentally changes all the time as I told you before and you've observed yourself.
VB.NET:
Me.CrystalReportViewer1.ReportSource = Application.StartupPath & "\POReportPrint.rpt"
 
Thx 4 ur time but i tried that and its still giving me login to database window coz i think it didnt find the database in the temp folder and my application startup path is correct
 
i tried that and im getting this error
{"Logon failed.
Details: ADO Error Code: 0x
Source: Microsoft OLE DB Service Components
Description: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
Error in File C:\DOCUME~1\BL@CKR~1\LOCALS~1\Temp\POReportPrint {411F3EA5-DBA1-48BB-8278-DDBCBB2EF248}.rpt:
Unable to connect: incorrect log on parameters."}

its still looking in the Temp folder
 
Back
Top