Relative Path to Access DB in VB.NET 
Author Message
 Relative Path to Access DB in VB.NET

I need some help please.

I coded an application with a hardcoded database link to a folder outside of
my app. I want to place the Access DB inside my app folder and use a
relative path to it. So I can use it on anybody's machine.
I use a lot of OLE data adapters. Will I have to change all of those?
Please let me know how I can do this the best way. Thank you.

Steve



Wed, 17 Aug 2005 10:50:09 GMT  
 Relative Path to Access DB in VB.NET
Hi:

This gives you the path (folder) of the executing
WindowsForms exe -- use this to code the path to the
database.

        Dim strExe As String
        Dim d As System.IO.FileInfo

        strExe =
System.Reflection.Assembly.GetExecutingAssembly.Location.To
String
        d = New System.IO.FileInfo(strExe)
        MsgBox(d.DirectoryName.ToString)

Naresh

Quote:
>-----Original Message-----
>I need some help please.

>I coded an application with a hardcoded database link to
a folder outside of
>my app. I want to place the Access DB inside my app
folder and use a
>relative path to it. So I can use it on anybody's machine.
>I use a lot of OLE data adapters. Will I have to change
all of those?
>Please let me know how I can do this the best way. Thank
you.

>Steve

>.



Wed, 17 Aug 2005 19:09:27 GMT  
 Relative Path to Access DB in VB.NET
Thank you so much for your help. But now I am really confused.
I guess I should not use the wizard for the OleDBadapter then? I have about
six of them in my app. Do I also have to receate the datasets?

Steve


Quote:
> Hi:

> This gives you the path (folder) of the executing
> WindowsForms exe -- use this to code the path to the
> database.

>         Dim strExe As String
>         Dim d As System.IO.FileInfo

>         strExe =
> System.Reflection.Assembly.GetExecutingAssembly.Location.To
> String
>         d = New System.IO.FileInfo(strExe)
>         MsgBox(d.DirectoryName.ToString)

> Naresh

> >-----Original Message-----
> >I need some help please.

> >I coded an application with a hardcoded database link to
> a folder outside of
> >my app. I want to place the Access DB inside my app
> folder and use a
> >relative path to it. So I can use it on anybody's machine.
> >I use a lot of OLE data adapters. Will I have to change
> all of those?
> >Please let me know how I can do this the best way. Thank
> you.

> >Steve

> >.



Thu, 18 Aug 2005 01:52:56 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Parsing an HTML Document - Change Relative paths to fully qualified paths

2. Use relative path for linked table in Access?

3. Best method of determining path, relative path and/or flie name

4. convert absolut path to relative path

5. Creating relative directory path given fully-qualified path

6. Access DB and VB.NET /Triggers?

7. VB .NET ADO Can't open Access DB

8. How to store file in an Access DB in VB.NET

9. Connection detection and DB Access on Internet using VB.NET

10. VB .NET ADO Can't open Access DB

11. VB .NET ADO Can't open Access DB

12. Direct 'net db access from vb app?

 

 
Powered by phpBB® Forum Software