dcsimg
Results 1 to 5 of 5

Thread: [RESOLVED] Data Source Connection (MS Access, crystal Reports)

  1. #1

    Thread Starter
    Member CherryPickle's Avatar
    Join Date
    Aug 2009
    Location
    South Africa
    Posts
    40

    Resolved [RESOLVED] Data Source Connection (MS Access, crystal Reports)

    Hi All,

    I have created a data source connection to an access db by using the wizard in vs2008. I have then used this as a data source for crystal reports. My user would like to put the database on a network and reference it there. Is there a way to set a new path for this data source during runtime?

  2. #2
    Hyperactive Member
    Join Date
    Jun 2009
    Posts
    307

    Re: Data Source Connection (MS Access, crystal Reports)

    You can use an OpenFileDialog to get the location of the database and then use the .filename property to get the file location for your connection string.

    Code:
    ' This is a basic example
    
    Dim con As New OleDb.OleDbConnection
    
    m_dbfile = OpenFileDialog1.FileName 
    
    con.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & m_dbfile & ""

  3. #3

    Thread Starter
    Member CherryPickle's Avatar
    Join Date
    Aug 2009
    Location
    South Africa
    Posts
    40

    Re: Data Source Connection (MS Access, crystal Reports)

    Tank you for your response.

    This portion I know.

    What I would like to know is if I have an existing data source created through the vs 2008 wizard, how to I reference and change the connection to this data source.

  4. #4
    Hyperactive Member
    Join Date
    Jun 2009
    Posts
    307

    Re: Data Source Connection (MS Access, crystal Reports)

    I guess I'm not sure what you're asking. You want to change the location of the data source after you've already connected to it?

  5. #5

    Thread Starter
    Member CherryPickle's Avatar
    Join Date
    Aug 2009
    Location
    South Africa
    Posts
    40

    Re: Data Source Connection (MS Access, crystal Reports)

    Thanks for help, but I found what I managed to solve my problem by following another route.

    Answer

Tags for this Thread

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