Используя следующие функции, как я могу использовать хранимую процедуру с параметрами.
Мне нужно вызвать хранимую процедуру, используя параметры для опыта работы, но я не могу работать так, как это будет работать, обычно у меня есть command.execute в параметре набора записей, а затем перебирать набор записей, чтобы получить мой вывод.
Приведенные ниже функции - это несколько избранных, которые я сузил для использования. Я вызвал хранимую процедуру, используя функцию набора записей.
1007 * записи *
function Recordset(sNewCommandText, iNewCommandType, iNewCommandTimeout, lng_RecordsetNumber)
obj_Command.CommandText = sNewCommandText
if IsNumeric(iNewCommandType) then
obj_Command.CommandType = iNewCommandType
else
obj_Command.CommandType = 1
end if
if IsNumeric(iNewCommandTimeout) then
obj_Command.CommandTimeout = iNewCommandTimeout
else
obj_Command.CommandTimeout = 3
end if
if RecordsetIsOpen(lng_RecordsetNumber) = 1 then
CloseRecordset lng_RecordsetNumber
end if
select case lng_RecordsetNumber
case 0
case 1
obj_Recordset1.Open obj_Command
case 2
obj_Recordset2.Open obj_Command
case 3
obj_Recordset3.Open obj_Command
case else
obj_ExtraRecSets.Item(lng_RecordsetNumber).Open obj_Command
end select
end function
Выполнить
function Execute(sNewCommandText, iNewCommandType, iNewCommandTimeout)
Execute= 0
obj_Command.CommandText = sNewCommandText
if IsNumeric(iNewCommandType) then
obj_Command.CommandType = iNewCommandType
else
obj_Command.CommandType = 1
end if
if IsNumeric(iNewCommandTimeout) then
obj_Command.CommandTimeout = iNewCommandTimeout
else
obj_Command.CommandTimeout = 3
end if
obj_Command.Execute
Execute= 1
end function
Получить поле
function GetField(FieldNumber, iFieldAttribute, lng_RecordsetNumber)
dim lng_tmpcnt
if RecordsetIsOpen(lng_RecordsetNumber) = 1 and IsNumeric(iFieldAttribute) and BOF(lng_RecordsetNumber) = 0 and EOF(lng_RecordsetNumber) = 0 then
select case iFieldAttribute
case 0
select case lng_RecordsetNumber
case 1
GetField = obj_Recordset1.Fields(FieldNumber).Type
case 2
GetField = obj_Recordset2.Fields(FieldNumber).Type
case 3
GetField = obj_Recordset3.Fields(FieldNumber).Type
case else
GetField = obj_ExtraRecSets.Item(lng_RecordsetNumber).Fields(FieldNumber).Type
end select
case 1
select case lng_RecordsetNumber
case 1
GetField = obj_Recordset1.Fields(FieldNumber).Name
case 2
GetField = obj_Recordset2.Fields(FieldNumber).Name
case 3
GetField = obj_Recordset3.Fields(FieldNumber).Name
case else
GetField = obj_ExtraRecSets.Item(lng_RecordsetNumber).Fields(FieldNumber).Name
end select
case 2
select case lng_RecordsetNumber
case 1
GetField = obj_Recordset1.Fields(FieldNumber).Value
case 2
GetField = obj_Recordset2.Fields(FieldNumber).Value
case 3
GetField = obj_Recordset3.Fields(FieldNumber).Value
case else
GetField = obj_ExtraRecSets.Item(lng_RecordsetNumber).Fields(FieldNumber).Value
end select
case 3
select case lng_RecordsetNumber
case 1
GetField = obj_Recordset1.Fields(FieldNumber).ActualSize
case 2
GetField = obj_Recordset2.Fields(FieldNumber).ActualSize
case 3
GetField = obj_Recordset3.Fields(FieldNumber).ActualSize
case else
GetField = obj_ExtraRecSets.Item(lng_RecordsetNumber).Fields(FieldNumber).ActualSize
end select
case else
select case lng_RecordsetNumber
case 1
for lng_tmpcnt=0 to obj_Recordset1.Fields(FieldNumber).Properties.count-1
if lng_tmpcnt <> 15 and lng_tmpcnt <> 17 then
GetField = GetField & lng_tmpcnt & " (" & obj_Recordset1.Fields(FieldNumber).Properties(lng_tmpcnt).name & "(" & obj_Recordset1.Fields(FieldNumber).Properties(lng_tmpcnt).type & ")= " & obj_Recordset1.Fields(FieldNumber).Properties(lng_tmpcnt).value & ")<br>" & vbcrlf
end if
next
case 2
for lng_tmpcnt=0 to obj_Recordset2.Fields(FieldNumber).Properties.count-1
if lng_tmpcnt <> 15 and lng_tmpcnt <> 17 then
GetField = GetField & lng_tmpcnt & " (" & obj_Recordset2.Fields(FieldNumber).Properties(lng_tmpcnt).name & "(" & obj_Recordset2.Fields(FieldNumber).Properties(lng_tmpcnt).type & ")= " & obj_Recordset1.Fields(FieldNumber).Properties(lng_tmpcnt).value & ")<br>" & vbcrlf
end if
next
case 3
for lng_tmpcnt=0 to obj_Recordset3.Fields(FieldNumber).Properties.count-1
if lng_tmpcnt <> 15 and lng_tmpcnt <> 17 then
GetField = GetField & lng_tmpcnt & " (" & obj_Recordset3.Fields(FieldNumber).Properties(lng_tmpcnt).name & "(" & obj_Recordset3.Fields(FieldNumber).Properties(lng_tmpcnt).type & ")= " & obj_Recordset3.Fields(FieldNumber).Properties(lng_tmpcnt).value & ")<br>" & vbcrlf
end if
next
case else
end select
end select
end if
end function