关于VBScript语言的问题,在线跪求答案,追加高分。
最上面的文本框<inputname="UserID"type="text"id="UserID"/>我想用文本框输入UserID,然后点击‘查询’,之后于数据库里的Use...
最上面的文本框 <input name="UserID" type="text" id="UserID" />
我想用文本框输入UserID,然后点击‘查询’,之后于数据库里的UserID相匹配,那么下面表单就显示出我想要的数据。
<%
Str=""
UesrID=Trim(Request.Form("UserID"))
If UserID <> "" Then
StrSql = "UserID"
End If
%>
<%
Dim Rs1
Dim Rs1_numRows
Set Rs1 = Server.CreateObject("ADODB.Recordset")
Rs1.ActiveConnection = MM_ebook_STRING
if Trim(Str)<>""then
Rs1.Source = "SELECT * FROM ShopBook where"&Str
else
Rs1.Source = "SELECT * FROM ShopBook"
Rs1.CursorType = 0
Rs1.CursorLocation = 2
Rs1.LockType = 1
Rs1.Open()
Rs1_numRows = 0
end if
%>
我该怎么改? 展开
我想用文本框输入UserID,然后点击‘查询’,之后于数据库里的UserID相匹配,那么下面表单就显示出我想要的数据。
<%
Str=""
UesrID=Trim(Request.Form("UserID"))
If UserID <> "" Then
StrSql = "UserID"
End If
%>
<%
Dim Rs1
Dim Rs1_numRows
Set Rs1 = Server.CreateObject("ADODB.Recordset")
Rs1.ActiveConnection = MM_ebook_STRING
if Trim(Str)<>""then
Rs1.Source = "SELECT * FROM ShopBook where"&Str
else
Rs1.Source = "SELECT * FROM ShopBook"
Rs1.CursorType = 0
Rs1.CursorLocation = 2
Rs1.LockType = 1
Rs1.Open()
Rs1_numRows = 0
end if
%>
我该怎么改? 展开
2个回答
展开全部
<%
Dim Rs1, Rs1_numRows, UesrID
UesrID=Trim(Request.Form("UserID"))
Set Rs1 = Server.CreateObject("ADODB.Recordset")
if UesrID <> "" then
Rs1.open "SELECT * FROM ShopBook where UesrID=" & UesrID, MM_ebook_STRING, 1, 1
else
Rs1.open "SELECT * FROM ShopBook", MM_ebook_STRING, 1, 1
end if
Rs1_numRows = Rs1.recordcount
%>
Dim Rs1, Rs1_numRows, UesrID
UesrID=Trim(Request.Form("UserID"))
Set Rs1 = Server.CreateObject("ADODB.Recordset")
if UesrID <> "" then
Rs1.open "SELECT * FROM ShopBook where UesrID=" & UesrID, MM_ebook_STRING, 1, 1
else
Rs1.open "SELECT * FROM ShopBook", MM_ebook_STRING, 1, 1
end if
Rs1_numRows = Rs1.recordcount
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询