



GSerg писал(а):Если ты её открыл, ты знаешь, где она.




Public Function DBPatch$()
Dim i&
DBPatch = Application.CurrentDb.Name
For i = Len(DBPatch) To 1 Step -1
    If Mid(DBPatch, i, 1) = "\" Then Exit For
Next i
DBPatch = Left(DBPatch, i)
End Function

0xy писал(а):Уже написал
- Код: Выделить всё
 Public Function DBPatch$()
Dim i&
DBPatch = Application.CurrentDb.Name
For i = Len(DBPatch) To 1 Step -1
If Mid(DBPatch, i, 1) = "" Then Exit For
Next i
DBPatch = Left(DBPatch, i)
End Function
CreateObject("Scripting.FileSystemObject").GetFile(Application.CurrentDb.Name).parentfolder.Path0xy писал(а):Вот только на InStrRev Access 97 ругается. Есть ли альтернатива (или самому писать?)
#If Not VBA6 Then
      Public Function StrReverse(ByVal sIn As String) As String
          Dim nC As Integer, sOut As String
          For nC = Len(sIn) To 1 Step -1
          sOut = sOut & Mid(sIn, nC, 1)
          Next
          StrReverse = sOut
      End Function
#End IfNicky писал(а):
- Код: Выделить всё
 CreateObject("Scripting.FileSystemObject").GetFile(Application.CurrentDb.Name).parentfolder.Path
CurrentProject.Path
KL писал(а):Nicky писал(а):
- Код: Выделить всё
 CreateObject("Scripting.FileSystemObject").GetFile(Application.CurrentDb.Name).parentfolder.Path
или так:
- Код: Выделить всё
 CurrentProject.Path
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 10