Этот баннер — требование Роскомнадзора для исполнения 152 ФЗ.
«На сайте осуществляется обработка файлов cookie, необходимых для работы сайта, а также для анализа использования сайта и улучшения предоставляемых сервисов с использованием метрической программы Яндекс.Метрика. Продолжая использовать сайт, вы даёте согласие с использованием данных технологий».
Политика конфиденциальности

Новые сообщения [новые:0]
Дайджест
Горячие темы
Избранное [новые:0]
Форумы
Пользователи
Статистика
Статистика нагрузки
Мод. лог
Поиск
|
|
01.08.2001, 12:31
|
|||
|---|---|---|---|
|
|||
Вызов хранимых процедур SQLServer из Access |
|||
|
#18+
Кто-нибудь может проиллюстрировать subj кусочком кода ? Заранее благодарен. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
01.08.2001, 13:01
|
|||
|---|---|---|---|
|
|||
Вызов хранимых процедур SQLServer из Access |
|||
|
#18+
В общем то думаю надо перейти к ADO. В сайте MicroSotf есть какой то фаил "Migrating from DAO to ADO.doc". Вот адрес не записал. Оттуда и етот фрагмент кода. Sub ADOExecuteParamQuery() Dim cnn As New ADODB.Connection Dim cat As New ADOX.Catalog Dim cmd As ADODB.Command Dim rst As New ADODB.Recordset Dim fld As ADODB.Field 'Open the connection cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\nwind.mdb;" 'Open the catalog cat.ActiveConnection = cnn 'Get the Command object from the Procedure Set cmd = cat.Procedures("Sales by Year").Command 'Specify the parameter values cmd.Parameters("Forms!Sales by Year Dialog!BeginningDate") _ = #8/1/1993# cmd.Parameters("Forms!Sales by Year Dialog!EndingDate") = #8/31/1993# ' Open the recordset rst.Open cmd, , adOpenForwardOnly, adLockReadOnly, adCmdStoredProc 'Display the records in the debug window While Not rst.EOF For Each fld In rst.Fields Debug.Print fld.Value & ";"; Next Debug.Print rst.MoveNext Wend 'Close the recordset rst.Close End Sub Удачу. bochin@dir.bg ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
01.08.2001, 14:24
|
|||
|---|---|---|---|
|
|||
Вызов хранимых процедур SQLServer из Access |
|||
|
#18+
For DAO: Function Execute_Passthrough_Query(sqltext As String) ' Purpose: Run a temporary pass-through query. ' Accepts: sqltext: SQL string to execute or stored procedure's name. ' Returns: nothing. Dim dbSQL As Database, qdSQL As QueryDef Dim strConnect As String Dim strCommand As String strConnect = “your connection string” Set dbSQL = DBEngine.Workspaces(0).Databases(0) ' Create a temporary QueryDef object that is not saved. Set qdSQL = dbSQL.CreateQueryDef("") ' Set the ReturnsRecords property to False in order to use the ' Execute method. qdSQL.ReturnsRecords = False qdSQL.Connect = strConnect qdSQL.SQL = sqltext qdSQL.Execute qdSQL.Close Set qdSQL = Nothing dbSQL.Close Set dbSQL = Nothing End Function Function Select_Passthrough_Query(sqltext As String) As Recordset ' Purpose: Run pass-through query. ' Accepts: sqltext: SQL string to execute or stored procedure's name. ' Returns: recordset. Dim dbSQL As Database Dim strConnect As String strConnect = “your connection string” Set dbSQL = DBEngine.Workspaces(0).OpenDatabase("", False, False, strConnect) Set Select_Passthrough_Query = dbSQL.OpenRecordset(SQL, dbOpenSnapshot, dbSQLPassThrough) End Function How to return records using Select_Passthrough_Query function: Private Sub Command1_Click() Dim rs as Recordset Dim strSQL as String strSQL= “MyStoredProcedureName” Set rs= Select_Passthrough_Query(strSQL).OpenRecordset End Sub ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
01.08.2001, 17:05
|
|||
|---|---|---|---|
Вызов хранимых процедур SQLServer из Access |
|||
|
#18+
А на примере процедуры sp_who примерчик можно ? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|

start [/forum/topic.php?fid=46&tablet=1&tid=1826004]: |
0ms |
get settings: |
7ms |
get forum list: |
15ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
44ms |
get topic data: |
12ms |
get forum data: |
3ms |
get page messages: |
49ms |
get tp. blocked users: |
2ms |
| others: | 248ms |
| total: | 386ms |

| 0 / 0 |
