Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving fields

Status
Not open for further replies.

edifreak

IS-IT--Management
Apr 7, 2003
74
0
0
AU
Hi,

I'm having problems retrieve a field from a sql database and displaying it in a form...

All I want to do is take a session variable on a form and compare it to the database and retrieve the info matching the session variable.

Below is the error i get...
Microsoft VBScript runtime error '800a000d'

********Error**********
Type mismatch: 'rsUser'


This is the function that gets the session variable... for testing purposes assume insite is the value of the session variable..

******** get user details**********

Sub getUserDetails()

Dim strSQL, params, tests
params = "insite"

strSQL = "UserDetails_sp"

set rsUser = ExecuteSP(strConnection, strSQL, params)

end sub


********Connect to the database**********

Function ExecuteSP(strConn, strSQL, params() )
Dim objComm
Dim rsRecords


set objComm = Server.CreateObject("ADODB.Command")
set objComm.ActiveConnection = CreateConnection(strConn)
objComm.CommandText = strSQL
objComm.Commandtype = adCmdStoredProc
objcomm.parameters.refresh
CollectParams objComm, params


Set rsRecords = CreateObject("ADODB.Recordset")

With rsRecords
Set .Source = objcomm
.LockType = adLockOptimistic
.CursorType = adOpenDynamic
.CursorLocation = adUseClient
.Open
Set .ActiveConnection = Nothing
End With

Set ExecuteSP = rsRecords

closeConnection

End Function

This is where I want to display the retrieved records

<INPUT type="<%=strType%>" id=Customer_name NAME=Customer_name VALUE=<%=rsUser("Password")%>>


Below is the contents of UserDetails_sp store d procedure...

**********Stored procedure**********
CREATE PROCEDURE dbo.UserDetails_sp
@Username varchar(25)

AS


SELECT Password
FROM users
WHERE rtrim(Username) = rtrim(@Username)
GO


Pls help! TIA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top