SQL String returns Nothing 2 !

Results 1 to 3 of 3

Thread: SQL String returns Nothing 2 !

  1. #1
    buddhi Guest

    Default SQL String returns Nothing 2 !

    *<BR><BR>Thanks for the help guys, but I am still not getting any output. I pared down the code to a kind of a "stump program":<BR><BR>&#060;%<BR>dim objconn &#039declare connection variable&#039<BR>Set objconn = Server.CreateObject("ADODB.Connection") &#039Server Method&#039<BR><BR>objconn.ConnectionString = "DSN=issues_log"<BR>objconn.open<BR><BR>dim objRS &#039use RecordSet to access the records&#039<BR>set objRS = Server.CreateObject("ADODB.Recordset")<BR><BR>dim strSQL &#039this is a SQL string object&#039<BR>dim inputVal &#039the value of variable from previous form<BR>dim tableName &#039so we know which table to display<BR><BR>inputVal = Cstr(request("inputVal"))<BR>tableName = Cstr(request("tableName"))<BR>&#039Response.write( inputVal)<BR>&#039Response.Write(tableName)<BR><BR >strSQL = "SELECT FirstName, LastName, Office, WorkPhone, Pager FROM People WHERE LastName=&#039"& inputVal & "&#039"<BR>objRS.Open strSQL, objConn<BR>Response.Write(StrSQL)<BR><BR><BR>while not objRS.EOF<BR><BR>Response.Write objRS("FirstName")<BR>Response.Write ("Is it working?")<BR><BR>objRS.MoveNext<BR>Wend<BR><BR><B R><BR>%&#062;<BR><BR>This is my output:<BR><BR>SELECT FirstName, LastName, Office, WorkPhone, Pager FROM People WHERE LastName=&#039Marissa&#039 <BR><BR>so the SQL string is working, however I get no records ... what am I doing wrong?

  2. #2
    buddhi Guest

    Default Never Mind, I got it - thanx win and Andy

    Sorry for the 2nd post. I got it ... I was looking in the wrong TABLE!! MY god ... what a doofus! Thanx again Win and Andy

  3. #3
    DL Guest

    Default RE: SQL String returns Nothing 2 !

    I would find it helpful to cut and paste that statement into an SQL query window to see what the results should be. Does the web user have select permission on the table?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts