Results 1 to 5 of 5

Thread: AppPath With ADO

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Edgerton, WI
    Posts
    381

    Post

    Most of the VB Databases that I have created and worked with were done in VB4 and VB5. I'd like to begin using VB6,ADO and the DataReports. I'd like to use AppPath so that the database file can be found whereever I install the application. Is it possible to use AppPath with ADO and DataReportss?

    Thanks, Rev. Michael L. Burns

  2. #2
    New Member
    Join Date
    Jan 2000
    Location
    Blackpool
    Posts
    14

    Post

    Why not create a app class object that stores all path information, database connection and generally application global information that gets created at startup. this way you can simply reference g_app.appname or g_app.localconnection etc
    Or store your path information in the registry instead of hard coding it

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Edgerton, WI
    Posts
    381

    Post

    Thanks for the food for thought. Never thought of trying it this way. Learn something new everyday.

    Rev. Michael L. Burns

  4. #4
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Post

    I found that the Database path in the DataEnvironment can be change redefine the connectionString at the procedure before you show the dataReport as below:

    'Set the DB Path for the Data Environment Object in runtime..
    WithDataEnvironment1.Connections.Item(<Your Connection Name> )
    .ConnectionString = "Provider=MSDataShape.1;Extended Properties=" & "Jet OLEDB atabase Password=<Your Password Here, If you have it>" & _
    ";Persist Security Info=False;Connect Timeout=15;Data Source=" & _
    "<Your Database path Here, Detect/Set with App.path at runtime>" & _
    ";Data Provider=MICROSOFT.JET.OLEDB.4.0"

    End With

    ------------------
    A free Man stand on a free Land.
    [email protected]

  5. #5
    Lively Member
    Join Date
    Feb 2000
    Posts
    120

    Post

    ofcourse you can !
    and dont forget to add to the chris's great answe that you can use an ini file and with an api you can read text from it and then change the string as you like for each p.c

    api:GETPROFILESTRING

    ------------------
    shachar shaty
    israel

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