當前位置:編程學習大全網 - 編程軟體 - ASP編程高手幫寫個小程序

ASP編程高手幫寫個小程序

首先妳在abc.mdb裏面要建立壹個表如name的表,裏面最少有id自動編號、username姓名。。才能進行下壹步操作,具體代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>無標題文檔</title>

</head>

<body>

<%

'連接OLEDB

Set oConn = Server.CreateObject("ADODB.CONNECTION")

oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("data/abc.mdb")

action = request("action") '判斷提交動作,

if action = "tj" then

username = request("username") '檢索提交過來的名稱

set rrs = server.CreateObject("adodb.recordset")

strSQL = "select name from [name] where name = '" & username & "'"

rrs.open strSQL ,conn ,1 ,1

if not rrs.eof then

response.Write("輸入正確" & username)

else

response.Write("輸入錯誤")

response.End()

end if

rrs.close

set rrs = nothing

end if

%>

<form method="post" action="?action=tj">

<input type="text" value="" name="username">

<input type="submit" value="修改" />

</form>

</body>

</html>

  • 上一篇:物料清單的檢測方法
  • 下一篇:為什麽不在金橋補課?
  • copyright 2024編程學習大全網