Results 1 to 6 of 6

Thread: Connection for Data Report... Help please

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2004
    Posts
    344

    Connection for Data Report... Help please

    Im using Data Connection and Data Report for reporting. I having this problem whenever I install the application in a new system into a different folder different from my original path where the database is (see attached "original connection"). An error (see attached "error") will be shown for me to type in my new path for my database whenever I click on the show report button. Is there anyway that Im able to solve this, so I do not have to keep typing the new path for the database. Please advice and thanks in advance...
    Attached Images Attached Images   

  2. #2
    Addicted Member iehjsucker's Avatar
    Join Date
    Sep 2005
    Posts
    150

    Re: Connection for Data Report... Help please

    in your code, you can set the connection to somewhat like this:

    app.path & "\data\x.mdb"

    this will get the path of your application and not a static path as to what you may have done





    =============
    ..code masters..

  3. #3
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    Re: Connection for Data Report... Help please

    could you post some code

    are you using adodb object or ded. if youre using adodb, then its a lot easier to solve this prob by using the sulution in post no 2.

    but if youre using ded, then its a lot more complicated thing.
    On error goto Trap

    Trap:
    in case of emergency, drop the case...

    ****************************************
    If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option.
    if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar

  4. #4
    Member
    Join Date
    Nov 2004
    Posts
    58

    Re: Connection for Data Report... Help please

    I have to agree it's a path problem. Try the App.Path something like...
    Code:
    connectionName.ConnectionString = _
      "Provider=Microsoft.Jet.OLEDB.4.0;" &_
      "Data Source=" & App.Path & "\databaseName.mdb"
    Steve

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2004
    Posts
    344

    Re: Connection for Data Report... Help please

    Quote Originally Posted by KinkyWiz
    I have to agree it's a path problem. Try the App.Path something like...
    Code:
    connectionName.ConnectionString = _
      "Provider=Microsoft.Jet.OLEDB.4.0;" &_
      "Data Source=" & App.Path & "\databaseName.mdb"
    Steve
    Where do I place these code? In the dataenvironment's connection? When I dbl click on the connection1?

    VB Code:
    1. Private Sub Connection1_InfoMessage(ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection)
    2. connectionName.ConnectionString = _
    3.   "Provider=Microsoft.Jet.OLEDB.4.0;" &_
    4.   "Data Source=" & App.Path & "\databaseName.mdb"
    5. End Sub

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Connection for Data Report... Help please

    Moved to reporting section

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