|
-
Oct 10th, 2001, 07:05 PM
#1
Thread Starter
Member
Q. about App.Path
I am trying to use app.path to denote the location of a database.
I am writing DataSource = App.Path + "file.mdb"
but it instead of adding c:\folder\file.mdb
it gives c:\folder\app.path\file.mdb
What gives?
Why is app.path added to the path??
Thanks.
-
Oct 10th, 2001, 07:07 PM
#2
Member
VB Code:
DataSource = App.Path & "\file.mdb"
There was no backslash, and the + might have done something weird. Does the code help at all?
-
Oct 10th, 2001, 07:19 PM
#3
PowerPoster
Originally posted by filburt1
VB Code:
DataSource = App.Path & "\file.mdb"
There was no backslash, and the + might have done something weird. Does the code help at all?
Not very likely but app.path could return "C:\", in which case that would blow up
VB Code:
Dim strAppPath as string
If right$(app.path,1) <> "\" Then
strapppath=app.path & "\"
else
strapppath=app.path
end if
That way, it will always have a backslash at the end
-
Oct 10th, 2001, 07:22 PM
#4
Member
Originally posted by chrisjk
Not very likely but app.path could return "C:\", in which case that would blow up
Just to clarify, it doesn't have to be the C: drive; it could return "D:\", "X:\", etc.
BTW, does App.Path work with UNC paths?
-
Oct 10th, 2001, 07:24 PM
#5
PowerPoster
Originally posted by filburt1
Just to clarify, it doesn't have to be the C: drive; it could return "D:\", "X:\", etc.
I think you know what I meant!
BTW, does App.Path work with UNC paths?
Not on a network at the moment so can't find out. I should think so though
-
Oct 10th, 2001, 07:24 PM
#6
Member
Originally posted by chrisjk
I think you know what I meant!
I know , I was just making sure everybody else did.
-
Oct 11th, 2001, 04:28 AM
#7
Well ...
Originally posted by FNC
I am trying to use app.path to denote the location of a database.
I am writing DataSource = App.Path + "file.mdb"
but it instead of adding c:\folder\file.mdb
it gives c:\folder\app.path\file.mdb
What gives?
Why is app.path added to the path??
Thanks.
The only way you could have got that result is if you enclosed App.Path in double quotation marks, i.e. instead of writing App.Path if you wrote "App.Path".
.
-
Oct 11th, 2001, 05:56 AM
#8
Member
Re: Well ...
Originally posted by honeybee
The only way you could have got that result is if you enclosed App.Path in double quotation marks, i.e. instead of writing App.Path if you wrote "App.Path".
For example, you might have typed "App.Path file.mdb", where App.Path would not have been parsed.
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
|