I am trying to run the following t-sql stored proc from my VBScript page
Create Procedure getUserInfo
(
@login nvarchar(8)
)
AS
USE proj_dashboard
SELECT f_forename, f_surname, f_profile_id
FROM t_users
WHERE f_login = @login
basically I wasnt to pull in the login of the user pass it to the proc and pull out the info for that user. I use the following sql statement
strSQL = "EXECUTE getUserInfo(logon)"
where logon is a var containing the users login.
which is passed in to the following function
Private Function RecSet(byVal connstring, byVal SQL)
Const adOpenForwardOnly = 0, adOpenKeyset = 1
Const adOpenDynamic = 2, adOpenStatic = 3
Const adLockReadOnly = 1, adLockPessimistic = 2
Const adLockOptimistic = 3, adLockBatchOptimistic = 4
Const adUseServer = 2, adUseClient = 3
Dim rs, Tmp
Set rs = Server.CreateObject("ADODB.Recordset")
With rs
.CursorType = adOpenStatic
.CursorLocation = adUseServer
.LockType = adLockReadOnly
.ActiveConnection = connstring
.Source = SQL
.Open
If .BOF then
Tmp = Null
Else
Tmp = .GetRows()
End If
.Close
End With
RecSet = Tmp
Set rs = Nothing
End Function
The error I get is Incorrect syntax near 'logon'.
Thank You for any help in advance.
Create Procedure getUserInfo
(
@login nvarchar(8)
)
AS
USE proj_dashboard
SELECT f_forename, f_surname, f_profile_id
FROM t_users
WHERE f_login = @login
basically I wasnt to pull in the login of the user pass it to the proc and pull out the info for that user. I use the following sql statement
strSQL = "EXECUTE getUserInfo(logon)"
where logon is a var containing the users login.
which is passed in to the following function
Private Function RecSet(byVal connstring, byVal SQL)
Const adOpenForwardOnly = 0, adOpenKeyset = 1
Const adOpenDynamic = 2, adOpenStatic = 3
Const adLockReadOnly = 1, adLockPessimistic = 2
Const adLockOptimistic = 3, adLockBatchOptimistic = 4
Const adUseServer = 2, adUseClient = 3
Dim rs, Tmp
Set rs = Server.CreateObject("ADODB.Recordset")
With rs
.CursorType = adOpenStatic
.CursorLocation = adUseServer
.LockType = adLockReadOnly
.ActiveConnection = connstring
.Source = SQL
.Open
If .BOF then
Tmp = Null
Else
Tmp = .GetRows()
End If
.Close
End With
RecSet = Tmp
Set rs = Nothing
End Function
The error I get is Incorrect syntax near 'logon'.
Thank You for any help in advance.