Results 1 to 3 of 3

Thread: form

  1. #1
    Join Date
    Dec 1969

    Default form

    I have a form and a results page. I have everything correct.<BR>When the data returns its returning only the first row of data. But In the sql statement I have a var, but no matter what data is inputed for the var it does not return that record. but the sqltext returns correct. here is my code:<BR><BR>&#060;%varStdidID=Request.Form("baID" ) <BR>Dim oRSt<BR>Set oRSt=Server.CreateObject("ADODB.recordset")<BR>sql text="SELECT * FROM Safety_Table1"<BR>sqltext=sqltext& " Where stdid=" & varStdidID & ";"<BR>oRSt.Open "SELECT * FROM Safety_Table1", "DSN=CSCbooks"<BR>Response.Write sqltext<BR>%&#062;<BR><BR>the data never changes with the var, why is this happening??

  2. #2
    Join Date
    Dec 1969

    Default RE: form

    You should be using the sqltext for the open method because right now your code is just selecting everything from the safety table.<BR><BR>oRSt.Open sqltext, "DSN=CSCbooks"<BR>

  3. #3
    Join Date
    Dec 1969

    Default Problem with Open connection

    I think that you have a TYPO in your code<BR>&#060;YOUR STUFF&#062;<BR>sqltext="SELECT * FROM Safety_Table1" <BR>sqltext=sqltext& " Where stdid=" & varStdidID & ";" <BR>oRSt.Open "SELECT * FROM Safety_Table1", "DSN=CSCbooks" <BR>Response.Write sqltext <BR>&#060;/YOU STUFF&#062;<BR><BR><BR>You have set up sqltext but dont use it ...<BR>shouldn&#039;t the oRSt.Open line actually read ..<BR>oRSt.Open sqltext, "DSN=CSCbooks" <BR>

Posting Permissions

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