Change the app.path? VB6 & Access-VBForums
Results 1 to 4 of 4

Thread: Change the app.path? VB6 & Access

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Posts
    66

    Change the app.path? VB6 & Access

    I have used the Package & Deployment Wizard to put my Visual Basic Program on CD, I then copied over my database 'calculations.mdb' onto the cd also so that the VB program can access the database when installed on another PC. However, the program still searches the same path as it does on my computer when trying to open the database whereas i would obviously like it to search for it wherever the user installs it. Is it possible to hardset this in my VB code? This is what it is set to at the moment:

    conconnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
    App.Path & "\" & "calculations.mdb;Mode=Read|Write"

    Does anyone know how I can adapt it? If not, is it possible to set it to search on the CD in the disk drive?(although this would be awkward as the user would have to keep the cd in there but better than nothing!)

    Thanks a lot!
    Amy

  2. #2
    #28 for the Yanks coming GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    6,900

    Re: Change the app.path? VB6 & Access

    When you create the Package and Delopment setup include the database in the setup files. This will place the DB into the same forlder as the app as it gets installed. Then you don't have to change the VB code it will still reside in App.Path
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Posts
    66

    Re: Change the app.path? VB6 & Access

    Sorry im not sure where you mean exactly. do i need to do that during the PDWizard or after? Once the package is created there is a folder called 'Support' but i tried putting it in there and didnt work. I also need to include the MS text-to-speech engine so that it installs if people dont have it. Would i just include this the same way as i will with the database?

    Thanks!

  4. #4
    #28 for the Yanks coming GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    6,900

    Re: Change the app.path? VB6 & Access

    The Package and Deployment Wizard will give you the option of adding files to the installation package (beside the OCX's and DLL's that it thinks belong). If you add the database file at this point the installation will include the file when the app is installed on the machine.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.