Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 8:28 on August 25, 2006

Help realize the database query

Asp brother is studying this is not a handbook procedures stumped me. Asp I have two documents, one index6.asp and example.asp.
Index6 the code :
"Html>
"Head are
"Meta http-equiv=" Content-Type "content=" text/html; charset=gb2312 ""
"Title> inquiries" /title>
"/head>
"Body>
"Form name="_ftn1"" form1 "method=" post "action=" example6.asp ""
Search : "Organization Department Holds Press Conference
Name =
"Input name="_ftn1"" Name "type=" government "filled="f"" Name "size =" 20 "maxlength=" 50 ""
And tel=
"Input name="_ftn1"" Tel "type=" government "filled="f"" Tel "size =" 20 "maxlength=" 50 ""
And message=
"Input name="_ftn1"" Message "type=" government "filled="f"" Message "size =" 20 "maxlength=" 50 ""
"Organization Department Holds Press Conference
"Input type=" submit "name="_ftn1"" submit "value=" submit ""
"Input type=" reset "name="_ftn1"" Submit2 "value=" replacement ""
"/form>

"/body>
"/html>


Example. Asp code :
<%
Name=request.form ( "Name")
Tel=request.form ( "Tel")
Message=request.form ( "Message")
Set conn=server.createobject ( "adodb.connection")
Conn.open "driver={microsoft access driver (*.mdb) };dbq=" &server.mappath ( "example.mdb")
Exec= "select * from guestbook where name="_ftn1" '" +name+ "' and tel=" +tel "and message= '" +message "'
Set rs=server.createobject ( "adodb.recordset")
Rs.open exec, conn,1,1
%>
"Html>
"Head are
"Title> database inquiries" /title>
"Meta http-equiv=" Content-Type "content=" text/html; charset=gb2312 ""
"/head>
"Body bgcolor=" #FFFFFF "text=" #000000 ""
"Table width=" 100% "border" 1 "cellspacing" 0 "cellpadding=" 0 ""
"Tr save the" center ""
"Td>ID</td>
"Td>name</td>
"Td>tel</td>
"Td>message</td>
"Td>time</td>
"Per
<%
Do while not rs.eof
%><tr Save the "center" "
"Td><%=rs (" ID ") %></td>
"Td><%=rs (" name ") %></td>
"Td><%=rs (" Tel ") %></td>
"Td><%=rs (the" message ") %></td>
"Td><%=rs (" time ") %></td>
"Per
<%
Rs.movenext
Loop
%>
"ShapeID="_x0000_i1025" DrawAspect="Content" ObjectID="_1127825915"> </o:OLEObject>
"/body>
"/html>


When the time to achieve operational mistakes that

Error Type :
Microsoft VBScript compiler errors (0x800A0401)
Unfinished sentences
/cong/temp/example6.asp, Line 7, column 65
Exec= "select * from guestbook where name="_ftn1" '" +name+ "' and tel=" +tel "and message= '" +message "'

Is that how to resolve!

Less a double quotation marks :
Exec= "select * from guestbook where name="_ftn1" '" +name+ "' and tel=" +tel "and message= '" +message "' [color=red][b]" [/b][/color]

Oh, but it came again, but did not query the search result you see that it is how else? ?

Www.jptpizza.com/cong/example.mdb database here :




 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com