|
-
Jan 8th, 2010, 02:25 PM
#1
Thread Starter
Member
[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?
-
Jan 8th, 2010, 07:01 PM
#2
Hyperactive Member
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 & ""
-
Jan 9th, 2010, 02:25 AM
#3
Thread Starter
Member
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.
-
Jan 9th, 2010, 09:21 AM
#4
Hyperactive Member
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?
-
Jan 9th, 2010, 02:11 PM
#5
Thread Starter
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|