Hi Folks,
I have a stored proc in which I want to return the resulting recordser. The stored proc works fine in QA and returns the corrct recordset. However, in my asp page, it just hangs.
I know my connection string is valid etc. I think I am just not putting the pieces together right.
I am unsure what I am doing wrong. Could someone be as so kind as tell me where I goofed?
Stored Proc
Alter PROC sel_clients_lastname
@CompanyId int,
@Lastname nvarchar(25)
with recompile
as
set nocount on
Select ClientId,FullName,HomePhon
e,WorkPhon
e, Email From Clients
Where CompanyId = @CompanyId AND FamilyOnly ='0'
AND LastName LIKE @Lastname
order by LastName, FirstName;
Coding:
Note vdbase is a variable containg connection string and it is valid.
variable vfindit is valid
vcompanyid is valid
set rsConn = Server.CreateObject("ADODB
.Connectio
n")
rsConn.Open vdbase
set rsCmds = Server.CreateObject("ADODB
.Command")
set rsRecs = Server.CreateObject("ADODB
.Recordset
")
set rsCmds.ActiveConnection = rsConn
rsCmds.CommandType = adcmdStoredProc
rsCmds.CommandText = "sel_clients_lastname"
rsCmds.Parameters.Append rsCmds.CreateParameter("RC
",adIntege
r,adParamR
eturnValue
)
rsCmds.Parameters.Append rsCmds.CreateParameter("Co
mpanyId",a
dInteger,a
dParamInpu
t,4,vcompa
nyid)
rsCmds.Parameters.Append rsCmds.CreateParameter("La
stname",ad
VarChar,ad
ParamInput
,25,vfindi
t)
set rsRecs = rsTT.Execute(rsCmds)
if not rsRecs.EOF then
while not rsRecs.EOF
blah blah
rsRecs.MoveNext
wend
end if
rsRecs.Close
set rsRecs = nothing
set rsCmds.ActiveConnection = nothing
set rsTT = nothing
:
Start Free Trial