Results 1 to 9 of 9

Thread: Deployment doubt...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2001
    Posts
    113

    Deployment doubt...

    Hello all,
    Im packaging my project with my database sitting in Apppath\data\db.mdb.
    For the connection string, I'm using the server's name with the path of my .mdb file. eg. '\\machine1\c\vb\data\insurance.mdb'
    If the installation is installed in another machine, then, my code won't work because of the wrong server path (\\machine1).
    To make my connection string general what should be done??

    Thanx in advance

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jul 2001
    Posts
    113

    Angry pls help...

    ???

  3. #3
    Lively Member
    Join Date
    Mar 2001
    Posts
    82
    Instead of hard coding the location of your .mdb file, change the directory to App.Path. App is a VB Object pointing to itself and the Property Path is its location. You could do the same for your Connection String though I think you'd have to do it manually and not through a DataEnvironment.

    Just to make sure your .mdb file exists so that you won't get an error when you try to access the DB, use the Scripting Runtime to check for the file's existence.

    Hope this helps.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2001
    Posts
    113
    Thanx for that,

    1. Im using Apppath already. What i want to know is the server's name. My server's (where db resides) name is hard-coded now. I want to automatically check and put the server's name.

    2. How do i use the scripting runtime?

    Thanx again

  5. #5
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    You should user a sort of options screen that allows the user to change the location, so it knows where to look. You can't really auto-detect...

    As for the scripting thing, goto Projects->References and check Microsoft Scripting Runtime

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jul 2001
    Posts
    113
    So, Can I use a form which would ask for the machine name and then use this machine name in the setup dynamically.

    Cheers

  7. #7
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    yep...ask for the machine name, store it somewhere, registry maybe, then use something like this
    VB Code:
    1. strPathtoFile = "\\" & strMachineNameFromReg & "\c\somepath\something.txt"

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jul 2001
    Posts
    113
    1. How do I store a variable in the registry and retrive the same variable's value into vb.
    2. How to include the form in the PDWizard.

  9. #9
    ruyeno22
    Guest

    are you using access???

    cause if you are using access you can use the registry to store the name of the server.

    the program would look for the server, and if the server is not found would ask the user to type the name of the server and save that info in tge registry.

    you can use a ini file too.

Posting Permissions

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



Click Here to Expand Forum to Full Width