Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

My application is not going to be as complex as most. I have a very small database of maybe 64 fields that I will be keeping in the same directory that my program is running in (maybe one directory higher).

 

Current Problem: I store my projects on a USB Flash Drive. This drive pops up as E:\ on some PCs and F:\ on others.

 

Predicted Problem: During installation, the user could install the program in C:\Program Files\Location1 or C:\Program Files\Company Name\Location2, etc.

 

See the problem? When I developed my Crystal Reports application named CRViewer1, the source path to the data file was E:\VB\NewProgram\CrystalReport.rpt. It works great on the machine that has the E:\ drive as my Flash Drive.

 

During runtime, if I try to open the database file CrystalReport.rpt with a call to the CRViewer1 on a machine where my Flash Drive shows up as drive F:\, then a Database Login screen pops up showing a field called Server Name with the default value E:\VB\NewProgram\database.mdb on display.

 

I can manually change the drive letter at this point to the F:\ drive; however, this is an unwanted bug in my system.

 

What parameter could I set to make this Server Name path use a variation of the Application.StartupPath? I'm thinking it would look something like this:

 CRViewer1.ReportSource = Application.StartupPath.Substring(0, Application.StartupPath.Length - 1))

Obviously, this does not work, and something like this would require me to manually set all the fields for the Crystal Reports viewer all over again (since it would overwrite what I had already).

 

Does anyone have any thoughts?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...