powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Microsoft SQL Server [игнор отключен] [закрыт для гостей] / Несколько рекордсетов ...
3 сообщений из 3, страница 1 из 1
Несколько рекордсетов ...
    #32064088
Jcomp
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Вот задумал сделать статистику по форуму.
Все что пришло в голову:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
select count(*) as colusers from users
select count(DATER) as rtoday from users where datediff(Day,[dateR],getDate())= 0 
select top  5  * from users where datediff(Day,[dateR],getDate())= 0  order by dateR desc

select count(*) as postoday from users where datediff(Day,[dateLA],getDate())= 0 
select top  5  * from users where datediff(Day,[dateLA],getDate())= 0  order by dateLA desc 

select count(*)as tem from forummessages where ParentItemId is NULL 
select count(*)as otvetov from forummessages where ParentItemId is not NULL 

select count([date]) as temtoday from forummessages where ParentItemId is NULL and datediff(Day,[date],getDate())= 0  
select top  5  *  from forummessages where ParentItemId is NULL and datediff(Day,[date],getDate())= 0  order by [date] desc
select count([date]) as otvetovtoday from forummessages where ParentItemId is not NULL and datediff(Day,[date],getDate())= 0  

Понятно дело ХП возращает кучу рекордсетов, может кто знает как из АСП к ним по очереди докопаться ?
Или есть какие - то другие модели(способы)... в один их не сведеш...
Хочу совета .. :-)
...
Рейтинг: 0 / 0
Несколько рекордсетов ...
    #32064090
Trong
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
вот так:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
Set oCmd  = Server.CreateObject( "ADODB.Command" )  
Set oCmd.ActiveConnection  = oConn
...
Set oRs = oCmd.Execute
 --работа с первым рекордсетом
 
Set oRs = oRs.NextRecordset
--со вторым
...
Рейтинг: 0 / 0
Несколько рекордсетов ...
    #32064096
Фотография Chicago
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
NextRecordset Method (ADODB.Recordset)
Clears the current Recordset object and returns the next Recordset by advancing through a series of commands.

Код: plaintext
Set recordset2 = recordset1.NextRecordset


Remarks
Use the NextRecordset method to return the results of the next command in a compound command statement or of a stored procedure that returns multiple results. If you open a Recordset object based on a compound command statement (for example, "SELECT * FROM table1;SELECT * FROM table2") using the Execute method on a Command or the Open method on a Recordset, ADO executes only the first command and returns the results to recordset. To access the results of subsequent commands in the statement, call the NextRecordset method.
...
Рейтинг: 0 / 0
3 сообщений из 3, страница 1 из 1
Форумы / Microsoft SQL Server [игнор отключен] [закрыт для гостей] / Несколько рекордсетов ...
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


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