powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Microsoft Access [игнор отключен] [закрыт для гостей] / Что такое DAO
2 сообщений из 2, страница 1 из 1
Что такое DAO
    #32329500
Старпом
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Знающие люди!!! Помогите!!!

Не понимаю. Беру книгу Гейтса на компакте смотрю пример - все работает
Переношу в свою базу - дает ошибку. Не нравится ему DAO.Recordset

Public Function acbDoSearchDynaset(ctlText As Control, _
ctlList As Control, strBoundField As String) As Variant

' Search through a bound listbox, given text to find from a text box.
' Move the list box to the appropriate row.
' The listbox can have either a table or a dynaset
' (a query or an SQL statement) as its row source.
' In:
' ctlText: a reference to the text box you're typing into
' ctlList: a reference to the list box you're looking up in
' strBoundField: the name of the field in the underlying
' table in which you're looking for values.
' Out:
' Return value: either 0 (no error) or an error variant
' containing the error number.

Dim rst As DAO.Recordset
Dim varRetval As Variant
Dim db As DAO.Database

On Error GoTo HandleErr

Set db = CurrentDb()
Set rst = db.OpenRecordset(ctlList.RowSource, dbOpenDynaset)
' Use the .Text property, because you've not yet left the
' control. Its value (or its .Value property) aren't
' set until you leave the control.
rst.FindFirst "[" & strBoundField & "] >= " & acbcQuote & ctlText.Text & acbcQuote
If Not rst.NoMatch Then
ctlList = rst(strBoundField)
End If
varRetval = acbcErrNoError

ExitHere:
acbDoSearchDynaset = varRetval
On Error Resume Next
rst.Close
Set rst = Nothing
Exit Function

HandleErr:
varRetval = CVErr(Err)
Resume ExitHere
End Function
...
Рейтинг: 0 / 0
Что такое DAO
    #32329504
Фотография Geo
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
У тебя явно акцесс не 97-й :)

В редакторе кода вызови меню Tools-References, в открывшемся окне найди строку Microsoft DAO ..., и поставь там флажок. И все будет хорошо.
--
Не "Гейтс", млин, а Гетц. Это наш кумир, не побоюсь этого слова. :)
...
Рейтинг: 0 / 0
2 сообщений из 2, страница 1 из 1
Форумы / Microsoft Access [игнор отключен] [закрыт для гостей] / Что такое DAO
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


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