Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / Microsoft Access [игнор отключен] [закрыт для гостей] / Как из кода определить работает mde или mdb? / 4 сообщений из 4, страница 1 из 1
23.12.2004, 11:57:02
    #32841128
Latuk
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Как из кода определить работает mde или mdb?
При закрытии программы у юзера делаю кое какие черные дела
этот код мне мешает при разработке
у юзера работает MDE
при разработке естественно MDB

Нужно что-то типа

If ItIsMde then блаблабла
...
Рейтинг: 0 / 0
23.12.2004, 12:03:56
    #32841159
TatianaT
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Как из кода определить работает mde или mdb?
if rihgt(currentproject.name ,1)="e" then
msgbox "mde or ade"
else
msgbox "mdb or adp"
end if
...
Рейтинг: 0 / 0
23.12.2004, 12:09:23
    #32841178
Как из кода определить работает mde или mdb?
Это подойдёт (цитата из справки)?

MDE Property

You can use the MDE property to determine whether a database has been saved as a .mde file.

Note This property is only available with a Microsoft Access database (.mdb)

Setting

When a database is saved as an .mde file, Microsoft Access adds the MDE property to the database and sets it to the String value "T".

The MDE property can be determined only by using Visual Basic and is read-only in all views.

Important Trying to determine the MDE property for a database that hasn't been saved as an .mde file will generate run-time error 3270 (property not found). The MDE property doesn't exist in a database until the database is saved as an .mde file.

Remarks

You can convert a database to an .mde file by pointing to Database Utilities on the Tools menu and clicking Make MDE File. When you save a database as an .mde file, Microsoft Access removes all editable source code, compiles all modules, and compacts the database. Your Visual Basic code still works, but the code cannot be viewed or changed. In addition, you can't add or make changes to form or report objects.

Warning Be sure to retain a copy of your original database. If you need to change any code or the design of objects in an .mde database, you must do so in the original database and then create a new .mde database. You will also need the original database in order to convert to future versions of Microsoft Access because you can't directly convert .mde files.

Saving a database as an .mde file is most appropriate when you want to prevent changes to forms or reports, or hide your Visual Basic code from the database users. You could also convert a database to an .mde file when you create your own wizards or for the front-end portion of a front-end/back-end application.

A replicated database can't be saved as an .mde file; however, once a database is saved as an .mde file, it can be replicated.
...
Рейтинг: 0 / 0
23.12.2004, 12:12:14
    #32841195
Как из кода определить работает mde или mdb?
А вот соответствующий пример (оттуда же):

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
Function IsItMDE(dbs as Object) As Boolean
    Dim strMDE As String
    On Error Resume Next
    strMDE = dbs.Properties("MDE")
    If Err =  0  AND strMDE = "T" Then
        ' This is an MDE database.
        IsItMDE = True
    Else
        IsITMDE = False
    End if
End Function
...
Рейтинг: 0 / 0
Форумы / Microsoft Access [игнор отключен] [закрыт для гостей] / Как из кода определить работает mde или mdb? / 4 сообщений из 4, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]