|
|
|
|
|
| | |
|
vbscript active server pages ASP vbscript SQL database informix oracle SQL Server Perl CGI Delphi PHP source code code sample samples program CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Re: Searching databases using HTML forms... |
From: |
umesh |
Date: |
9/29/2000 12:10:46 PM |
IP: |
12.25.60.250 |
hi there,
this is how you do it
let us say you want to search for info about a person whose name is say umesh you need to follow this code
1.create a html page which has a form, a text field and a submit button.(say one.html)
2.for the form set the action="two.asp"
3. when you view this page in the browser it will have a text box that you will use to enter a name.
4.on two.asp write
<%@ Language=VBScript%>
<%
Set dbconn=Server.CreateObject("ADODB.Connection")
Set rsname=Server.CreateObject("ADODB.Recordset")
sql="Select * from table_name where name="
& request.form("text1")
dbconn.Open "DSNname"
rsname.Open sql,dbconn,1,3
if not rs.EOF then
response.write rsname.fields(i) & "<BR>"
end if
%>
this will display all the information about the person.
hope that satisfies you,if not feel free to mail me
regards umesh
|
Previous Message
|
|
|
|
|
|
|
|
|
|
|
|