farrukhijaz
06-10-2007, 09:38 AM
I have database in sql server 2000. I am creating session starting from login page. session value is successfully passed to 2nd page. I want to extract profile information from the same table (employees) that contains login and password.
in 2nd page, recordset in vbscript is giving error.
my record set code is given below.
<!--#include file="Connections/test_travel.asp" -->
<%
Dim profile_show
Dim profile_show_numRows
a = session("sessSignum")
Set profile_show = Server.CreateObject("ADODB.Recordset")
profile_show.ActiveConnection = MM_test_travel_STRING
profile_show.Source = "SELECT * FROM dbo.test_emp WHERE Signum = ' " & session("sessSignum") & " '"
profile_show.CursorType = 0
profile_show.CursorLocation = 2
profile_show.LockType = 1
profile_show.Open()
profile_show_numRows = 0
%>
<body>
<form id="form1" name="form1" method="post" action="">
<% b =(profile_show.Fields.Item("Signum").Value)%></form>
</body>
</html>
<%
profile_show.Close()
Set profile_show = Nothing
%>
the code runs fine if we give exact value in sql WHERE clause. but putting in some variable give error.
urgent help needed.
in 2nd page, recordset in vbscript is giving error.
my record set code is given below.
<!--#include file="Connections/test_travel.asp" -->
<%
Dim profile_show
Dim profile_show_numRows
a = session("sessSignum")
Set profile_show = Server.CreateObject("ADODB.Recordset")
profile_show.ActiveConnection = MM_test_travel_STRING
profile_show.Source = "SELECT * FROM dbo.test_emp WHERE Signum = ' " & session("sessSignum") & " '"
profile_show.CursorType = 0
profile_show.CursorLocation = 2
profile_show.LockType = 1
profile_show.Open()
profile_show_numRows = 0
%>
<body>
<form id="form1" name="form1" method="post" action="">
<% b =(profile_show.Fields.Item("Signum").Value)%></form>
</body>
</html>
<%
profile_show.Close()
Set profile_show = Nothing
%>
the code runs fine if we give exact value in sql WHERE clause. but putting in some variable give error.
urgent help needed.