The code bellow functions well. However if I want to obtain a return
value using the code bellow, how is it done?
<%
Sub RunQueryString (pSQL,parms)
on error resume next
Set conn = Server.CreateOb ject("ADODB.Con nection")
conn.open "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" &
Server.MapPath( "/db/upload/stelladb.mdb") & ";"
Set cmd = Server.CreateOb ject("adodb.com mand")
With cmd
..CommandText = pSQL
..CommandType = 1
set .ActiveConnecti on = conn
err.clear
..Execute ,parms,128
if Err.number <> 0 then
Response.Write( Err.number & ":" & Err.Description & "
")
end if
on Error goto 0
End with
conn.close
Set conn = nothing
End Sub
%>
<%
if Request.QuerySt ring("Action") = 1 then
username = Trim(request.fo rm("username") )
password = Trim(request.fo rm("password") )
if username <> "" and password <> "" then
arParms = Array(username, password)
sql = "SELECT Count(*) FROM Account WHERE username=? AND password=?"
RunQueryString sql, arParms
end if
end if
%>
value using the code bellow, how is it done?
<%
Sub RunQueryString (pSQL,parms)
on error resume next
Set conn = Server.CreateOb ject("ADODB.Con nection")
conn.open "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" &
Server.MapPath( "/db/upload/stelladb.mdb") & ";"
Set cmd = Server.CreateOb ject("adodb.com mand")
With cmd
..CommandText = pSQL
..CommandType = 1
set .ActiveConnecti on = conn
err.clear
..Execute ,parms,128
if Err.number <> 0 then
Response.Write( Err.number & ":" & Err.Description & "
")
end if
on Error goto 0
End with
conn.close
Set conn = nothing
End Sub
%>
<%
if Request.QuerySt ring("Action") = 1 then
username = Trim(request.fo rm("username") )
password = Trim(request.fo rm("password") )
if username <> "" and password <> "" then
arParms = Array(username, password)
sql = "SELECT Count(*) FROM Account WHERE username=? AND password=?"
RunQueryString sql, arParms
end if
end if
%>
Comment