| |
imav8n
Posts: 95
Score: 0
Joined: 7/3/2001
From: USA
Status: offline
|
Try this (page name is: page3.asp) : <%@ Language = VBscript %> <html> <head> <title>New Page 1</title> </head> <% 'Get variables from the querystring. typedname = Request.QueryString("thebox") if typedname <> null then 'Open database connection set conncarname = server.createobject("ADODB.Connection") conncarname.ConnectionString = "DSN=DCOINFO" conncarname.open 'Create the SQL Statement SQLCARNAME="SELECT forename FROM Staffnames WHERE surname=" & typedname & ";" 'Create the RecordSet and open with SQL statement Set CarNameRS = CreateObject("ADODB.Recordset") CarNameRS.open SQLCARNAME, conncarname end if %> <body> <form name="myform" action=page3.asp method=get> <p><input type="Text" name="thebox" size="25"><br> <input type="Submit" value="Take A Look" align="MIDDLE"> </p> </form> Forename is: <% CarNameRS("forename") %> </body> </html> ************************************************************* When this page opens, it checks to see if the variable is null...if it is (meaning the first time that it's called) then all the page displays is the form field to enter a name. When you hit submit, the form submits the textfield to the same page, which searches the database and displays the info. Let me know if you need any help with this... ~imav8n Failure is not an option.....it comes bundled with the software.
|
|