asp資料庫查詢,ASP資料庫查詢

時間 2022-03-12 04:29:37

1樓:匿名使用者

search.asp

show.asp

'連線資料庫 略

<

response.write "id 姓名 身份證號 參加工作日期 基本工資"

do while not pa.eof

pa.movenext

loop

pa.close

%>

2樓:

剛好有個相似的,改動改動發給你!

search.asp:

————————————————————

show.asp:

<% @language=vbscript %>

<%dim bname,btype,pname,ptype,aname,atype,mname,mtype,continue,currentpage,rowcount,i

continue=0

currentpage=trim(request("gopage"))

if currentpage="" then currentpage=1

bname=trim(request("bookname"))

btype=trim(request("booktype"))

pname=trim(request("publisher"))

ptype=trim(request("pubtype"))

aname=trim(request("author"))

atype=trim(request("auttype"))

mname=trim(request("money"))

mtype=trim(request("moneytype"))

if bname="" and pname="" and aname="" and mname="" then response.redirect "請填入資訊!"

mysql="select * from aa where "

if bname<>"" then

if btype=1 then

mysql=mysql & "姓名='" & bname & "'"

continue=1

else

mysql=mysql & "姓名 like '%" & bname & "%'"

continue=1

end if

end if

if pname<>"" then

if continue=1 then mysql=mysql & "and "

if ptype=1 then

mysql=mysql & "身份證號='" & pname & "'"

continue=1

else

mysql=mysql & "身份證號 like '%" & pname & "%'"

continue=1

end if

end if

if aname<>"" then

if continue=1 then mysql=mysql & "and "

if atype=1 then

mysql=mysql & "參加工作日期='" & aname & "'"

else

mysql=mysql & "參加工作日期 like '%" & aname & "%'"

end if

end if

if mname<>"" then

if continue=1 then mysql=mysql & "and "

if mtype=1 then

mysql=mysql & "基本工資='" & mname & "'"

else

mysql=mysql & "基本工資 like '%" & mname & "%'"

end if

end if

%>姓名身份證號

參加工作日期

基本工資

<%set con=server.createobject("adodb.connection")

con.open "dsn=xhnew.mdb;dbq=d:

\..\xhnew.mdb;driverid=25;fil=msaccess;maxbuffersize=2048;"

set rs=server.createobject("adodb.recordset")

rs.open mysql,con,adopenstatic

rs.pagesize=15

if not rs.eof then rs.absolutepage=cint(currentpage)

rowcount=0

while not rs.eof and rowcount

<%=(rs("姓名"))%>

<%=(rs("身份證號"))%>

<%=(year1 & "年" & month1 & "月" & day1 & "日")%>

<%=(rs("基本工資"))%>

<%rowcount=rowcount+1

rs.movenext

wend

for i=rowcount+1 to rs.pagesize

%><%next

%>第<%response.write(currentpage)

%>頁/共

<%if rs.pagecount>0 then

response.write(rs.pagecount)

else

response.write("1")

end if

%>頁沒人喜歡做問答題,誰都喜歡做選擇題!要自己勤動手!

3樓:匿名使用者

拜託 你好得寫點啊 完全讓別人幫你寫 真行

asp 資料庫連線

dim sqldatabasename,sqlpassword,sqlusername,sqllocalname,connstr,conn sqldatabasename sql資料庫名 sqlusername sql資料庫使用者名稱 sqlpassword sql資料庫使用者密碼 sqllocal...

asp修改access資料庫資料問題

貌似沒有問題 看看newsid有值沒 response.write sql response.end 建議你把這些全部輸出一遍,看是否有問題 response.write request name response.write request link response.write request ...

關於asp程式對資料庫使用

1全部以前同學寫 的時候做過簡單測試,access資料庫超過五十m的時候查詢連線呼叫的速度什麼很慢.大型的資料庫如果幾萬條資料查詢的話還是用sql,而且要考慮到資料查詢,翻頁時的規則,我的 就是八萬條資料用sql查起來直接翻頁的話很慢,網上有一些記錄查詢的規則可以研究一下.為了 以後發展和移植考慮還...

asp連線sql資料庫的問題

需要兩個頁面 前台輸入頁 後台頁 xm trim request xm 接著就是連線資料庫查詢 然後就是把記錄集的內容一條一條列印 for i 1 to rs.recordcountif rs.eof then exit for end if rs pwd rs.movenext next end ...

asp表單直接提交到資料庫,ASP表單直接提交到資料庫

set rs server.createobject adodb.recordset rs.open select from name conn,1,3 rs.addnew rs name name rs age age rs.update 加個更新 set rs nothing conn.clos...