在 ASP Classic 中搜索

发布于 2024-12-12 01:16:17 字数 861 浏览 0 评论 0原文

有人请帮我在 ASP 经典(库存系统)中进行搜索..我是编程新手和学生..下面是屏幕的样子。

http://imageshack.us/photo/my-images/707/searchc。 jpg/

说明

  1. 用户可以在自由文本字段中输入自由文本

  2. 用户可以选择按 assetNo/serialNo 搜索或选择全部。

    p>
  3. 用户可以选择所有字段..

然后数据将分页显示在下面..用户也可以保存在Excel中。

代码。

<%
Dim adoCon         
Dim rsGuestbook    
Dim strSQL           
Dim lngRecordNo    

lngRecordNo = CLng(Request.QueryString("ID"))
Set rsGuestbook = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM tbl_Master WHERE ID=" & lngRecordNo
rsGuestbook.Open strSQL, oConn
%>

数据库 SQL Server

table name (tbl_Master)..Attributes (AssetNo,Region,SerialNo,Manufacturer,dateCreate)

非常感谢

anyone please help me to do searching in ASP classic(inventory system)..i newbie in programming and students..below is the screen look like.

http://imageshack.us/photo/my-images/707/searchc.jpg/

explanation

  1. User can input free text in free text field

  2. User can select either searching by assetNo/serialNo or select All.

  3. User can select all field..

then data will display below with paging..user also can save in excel.

code.

<%
Dim adoCon         
Dim rsGuestbook    
Dim strSQL           
Dim lngRecordNo    

lngRecordNo = CLng(Request.QueryString("ID"))
Set rsGuestbook = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM tbl_Master WHERE ID=" & lngRecordNo
rsGuestbook.Open strSQL, oConn
%>

Database SQL Server

table name (tbl_Master)..Attributes (AssetNo,Region,SerialNo,Manufacturer,dateCreate)

Thanks you so much

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青芜 2024-12-19 01:16:17

我不确定您到底在寻找什么,但这可能会有所帮助:

<%
Dim adoCon         
Dim rsGuestbook    
Dim strSQL           
Dim lngRecordNo

'Added
Dim query, assetNumber, region

query = Trim(Request("your field name"))
assetNumber = Trim(Request("Asset Number Dropdown Name"))
region = Trim(Request("Region Dropdown Name"))

if query = "" then
query = "%"
End If

if assetNumber = "" then
assetNumber = "%"
End If

if region = "" then
region = "%"
End If

lngRecordNo = CLng(Request.QueryString("ID"))
Set rsGuestbook = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM tbl_Master WHERE FREETEXT(*, '"& query &"') AND AssetNo LIKE '"& assetNumber &"' AND Region LIKE = '"®ion&"' AND ID = " & lngRecordNo
rsGuestbook.Open strSQL, oConn
%>

Im not sure what exactly are you looking for but this might help:

<%
Dim adoCon         
Dim rsGuestbook    
Dim strSQL           
Dim lngRecordNo

'Added
Dim query, assetNumber, region

query = Trim(Request("your field name"))
assetNumber = Trim(Request("Asset Number Dropdown Name"))
region = Trim(Request("Region Dropdown Name"))

if query = "" then
query = "%"
End If

if assetNumber = "" then
assetNumber = "%"
End If

if region = "" then
region = "%"
End If

lngRecordNo = CLng(Request.QueryString("ID"))
Set rsGuestbook = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM tbl_Master WHERE FREETEXT(*, '"& query &"') AND AssetNo LIKE '"& assetNumber &"' AND Region LIKE = '"®ion&"' AND ID = " & lngRecordNo
rsGuestbook.Open strSQL, oConn
%>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文