Jump to content

App.Path Error when Compiled

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Guest_roger_*

Guest_roger_*
  • Guests
Dim strDBPath As String

strDBPath = App.Path

If Right(strDBPath, 1) <> "\" Then
datAgents.DatabaseName = App.Path & ".\IPM-DB.mdb"
End If



I use this to find my MS Access DB file. When I use the Package & Deployment wizzard and install the program on the same PC where my Visual Studio is installed I don't get any errors.

When I install it on another PC WITHOUT Visual Studio installed I get the error:

"Provide cannot be found. It may not be properly installed". I almost smacked my screen off the desk. I remember this error from 3 years ago when I use code in VB a lot.

Is this because I havn't installed DotNet SDK 1.1 on the other PC?

I know the piece of code I pasted above is the reason for the error, coz if I remove it and set the databasename/connectionstring to C:\Program Files\IPM\, i don't get no errors. This is not good coding so I don't wanna do it.

Please help!

#2
Lop

Lop

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,172 posts
If you didn't have the correct DotNet on the other computer your installer would of detected it assuming you used Setup and Deploy wizard in Visual Studio.

What version of Visual Basic are you using? It looks like 6.0.

#3
brackett

brackett

    Programmer

  • Members
  • PipPipPipPip
  • 192 posts
Uhh..what happens if App.Path ends in a "\"?

#4
o0TheNerd0o

o0TheNerd0o

    Learning Programmer

  • Members
  • PipPipPip
  • 61 posts
Nothing happens if it ends in "\", just as long as you don't put a "\" after the filename. Why do you have a "." right before your "\" in your first post? That would cause it to error.