By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,122 Members | 927 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,122 IT Pros & Developers. It's quick & easy.

InSrRev( ) problem

P: n/a
Dear all,

Acess 2000. Here is may problem : i want to extract the path of
my DB without thr name of the DB file, something like
D:\MyFolder\ I use this code but the Instrrev line is not
accepted : error (5) and (I try to translate) : incorect argument
or or procedure call. What is wrong ? (References ?)

Private Sub Form_Open(Cancel As Integer)
Dim Bigpath As String
Dim SmallPath As String
Dim Slashloc As Integer

Bigpath = CurrentProject.FullName ' ok
Slashloc = InStrRev(CheminComplet, "\", Len(Bigpath)) ' this line
failed (?), Len(bigpath) works
Path = Left(CheminComplet, Slashloc)
End Sub

Thank you
Alan--
_________________________________

Site photo personnel :

http://perso.wanadoo.fr/dimphoto
Nov 12 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
I've had similar problems with string functions (specifically, strconv()),
and found that they had to do with the comparison type. You should check out
the optional compare argument in the InStrRev() function and look at this
posting on a problem with the defaults:

http://www.trigeminal.com/usenet/usenet001.asp?1033
HTH,

Bruce Rusk

"Alain." <_@wanadoo.fr> wrote in message
news:bk**********@news-reader1.wanadoo.fr...
Dear all,

Acess 2000. Here is may problem : i want to extract the path of
my DB without thr name of the DB file, something like
D:\MyFolder\ I use this code but the Instrrev line is not
accepted : error (5) and (I try to translate) : incorect argument
or or procedure call. What is wrong ? (References ?)

Private Sub Form_Open(Cancel As Integer)
Dim Bigpath As String
Dim SmallPath As String
Dim Slashloc As Integer

Bigpath = CurrentProject.FullName ' ok
Slashloc = InStrRev(CheminComplet, "\", Len(Bigpath)) ' this line
failed (?), Len(bigpath) works
Path = Left(CheminComplet, Slashloc)
End Sub

Thank you
Alan--
_________________________________

Site photo personnel :

http://perso.wanadoo.fr/dimphoto

Nov 12 '05 #2

P: n/a
> Acess 2000. Here is may problem : i want to extract the path of
my DB without thr name of the DB file, something like
D:\MyFolder\ I use this code but the Instrrev line is not
accepted : error (5) and (I try to translate) : incorect argument
or or procedure call. What is wrong ? (References ?)


Try:

Application.CurrentProject.Path

--
Bruce M. Thompson, Microsoft Access MVP
bt******@mvps.org (See the Access FAQ at http://www.mvps.org/access)
NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<
Nov 12 '05 #3

P: n/a
Thank you Bruce,

It works as I have rebooted the PC. I went on the Trigeminal site
and found the explanantion of the phenomenom.
But I still wonder which option is the best : should I use the
1036 LCID (France) or leave it with the "option Compare Database"

Your opinion ?

--
_________________________________

Site photo personnel :

http://perso.wanadoo.fr/dimphoto
Nov 12 '05 #4

P: n/a
"Alain." <_@wanadoo.fr> wrote in message news:<bk**********@news-reader1.wanadoo.fr>...
Dear all,

Acess 2000. Here is may problem : i want to extract the path of
my DB without thr name of the DB file, something like
D:\MyFolder\ I use this code but the Instrrev line is not
accepted : error (5) and (I try to translate) : incorect argument
or or procedure call. What is wrong ? (References ?)

Private Sub Form_Open(Cancel As Integer)
Dim Bigpath As String
Dim SmallPath As String
Dim Slashloc As Integer

Bigpath = CurrentProject.FullName ' ok
Slashloc = InStrRev(CheminComplet, "\", Len(Bigpath)) ' this line
failed (?), Len(bigpath) works
Path = Left(CheminComplet, Slashloc)
End Sub

Alain, what is CheminComplet ?
It looks like a not initialized variable or some other global variable
not mentioned ..
shouldn't that be BigPath instead ?

Marc
Nov 12 '05 #5

P: n/a
Yes, CheminCimplet is Bigpath.

--
_________________________________

Site photo personnel :

http://perso.wanadoo.fr/dimphoto
Nov 12 '05 #6

P: n/a
Six of one, half a dozen of the other. :-)
--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.
"Alain." <_@wanadoo.fr> wrote in message
news:bk**********@news-reader3.wanadoo.fr...
Thank you Bruce,

It works as I have rebooted the PC. I went on the Trigeminal site
and found the explanantion of the phenomenom.
But I still wonder which option is the best : should I use the
1036 LCID (France) or leave it with the "option Compare Database"

Your opinion ?

--
_________________________________

Site photo personnel :

http://perso.wanadoo.fr/dimphoto

Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.