troubleshooting Question

ASP And SQL Field values not showing up

Avatar of stephentrice
stephentrice asked on
14 Comments1 Solution444 ViewsLast Modified:
I have converted my members database to SQL. I am able to verify form data against the login fields. There are 5 fields I want to use a session variables. When I try to use these I come back with blank values. I have tried Response.Write on these fields, and they also come back empty. I am able to return the values of two fields out of the data base "key", and "cid". These are both either "numeric", or "int" data types. The fields I am unable to return are "char",  "ntext", or "text"  data types. Can I not return text fields to my asp Pages? Anyway here is the ASP Code.

'Request Form Information
StrUser = LCase(Request.Form("strUserName"))
strPass = LCase(Request.Form("strPassword"))

'Open DB Connection
Set DSNConn = Server.CreateObject("ADODB.Connection")
DSNConn.Open "DSN=Login;uid=steve ;pwd=steve"
ssql = "SELECT * from Members"
Set  objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open ssql, DSNconn

'Loop Thru Record Set
'Format login fields
  strLUserName = LCase(objRS.Fields("NUser"))
  strLPassword = LCase(objRS.Fields("NPass"))

  'Compare Form Information to Record Set. Response.Write Fields to check values
  IF strLUserName = StrUser and strPass = strLPassword Then
    Response.Write "<br>" & objRS.Fields("GCTNNumber")
    Response.Write "<br>" & objRS.Fields("FullName")    
    Response.Write "<br>" & objRS.Fields("Zip")
    Response.Write objRS.Fields("cid")
    'Create Session Variables
     Session("GCTNNumber") = objRS.Fields("GCTNNumber")
     Session("lname") = objRS.Fields("lastname")
     Session("cid") = objRS.Fields("cid")
     Session("FullName") = objRS.Fields("FullName")
     Session("LMiles") = objRs.Fields("LMiles")

     END IF

'None Member Redirect

I am using ASP 3.0 running on a Windows Server 2003 Box with IIS 6.0. SQLServer 2000. Thanks!

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 14 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros