ASPÁ¬½ÓaccessÊý¾Ý¿âÀý³Ì

·¢²¼Ê±¼ä:2006-04-18 22:57:40   ä¯ÀÀÈËÊý: 522664 ´Î  
  ¹Ø¼ü×Ö: accessÊý¾Ý¿â - ±¾Õ¾ËÑË÷ - GoogleËÑË÷ - BaiduËÑË÷ - YahooËÑË÷ - sougoËÑË÷
ASPÁ¬½ÓaccessÊý¾Ý¿âÀý³Ì
×¢Ò⣺ҪÔËÐÐÉÏÊöACCESSÀý³ÌÇëÏÈÏÂÔØÊý¾Ý¿â£¬·ÅÔÚdb »ò rwdataÎļþ¼ÐÏ¡£Ç뽫Àý³Ì·ÅÔÚ¸ùĿ¼Ï¡£
<%
Dim mode
mode=request.form("text4")
if mode=1 then
name=request.form("text1")
age=request.form("text2")
addr=request.form("text3")
if not isnumeric(age) then response.write "age must be number!try again":response.end
age=clng(age)
end if
'********************************************************************
' ÓëAccessDBÏà¹ØµÄÁ¬½ÓÐÅÏ¢
' ¿ÉÒÔ²ÎÕÕËü½¨Á¢ÄúµÄÊý¾Ý¿âÁ¬½Ó
'********************************************************************
Dim conn,rs,dbpath
Set conn=Server.CreateObject("ADODB.Connection")
Set rs=Server.CreateObject("ADODB.RecordSet")
dbpath=Server.MapPath("rwdata/db_test_com.mdb")
conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ="&dbpath
'********************************************************************
'********************************************************************

dim strsql
'********************************************************************
' ¶ÁÊý¾Ý¿âÏà¹Ø²Ù×÷
sub readdb()
strsql="select * from test"
rs.open strsql,conn,1,1
if rs.EOF then response.write "no record at all":exit sub
response.write "

"
response.write "
"
for i=0 to rs.Fields.Count-1
response.write "
"
next
response.write "
"
while not rs.EOF
response.write "
"
for i=0 to rs.Fields.Count-1
response.write "
"
next
response.write "
"
rs.MoveNext
wend
response.write "
"&rs.Fields(i).Name&"
"&rs.Fields(i).Value&"
"
rs.Close
end sub
'********************************************************************


'********************************************************************
' дÊý¾Ý¿âÏà¹Ø
sub insertdata()
strsql="INSERT INTO test(name,age,addr) VALUES('"&name&"',"&age&",'"&addr&"')"
rs.Open strsql,conn,1,3
end sub
'********************************************************************

if mode=1 then
call insertdata()
response.write "insert ok!"
elseif mode=2 then
call readdb()
end if

'********************************************************************
' ÊÍ·ÅÊý¾Ý¿âÁ¬½Ó¶ÔÏó
set rs=nothing
set conn=nothing
%>







name:
age:
city:






×¢Ò⣺ҪÔËÐÐÉÏÊöACCESSÀý³ÌÇëÏÈÏÂÔØÊý¾Ý¿â£¬·ÅÔÚrwdataÎļþ¼ÐÏ¡£Ç뽫Àý³Ì·ÅÔÚ¸ùĿ¼Ï¡£




ÉÏһƪ£º¿Õ¼äÉúЧºóÈçºÎͨ¹ýLeapftpÉÏ´«ÍøÒ³£¿
ÏÂһƪ£ºFTP¹¤¾ß£¬¿Õ¼äÉúЧºóÈçºÎͨ¹ýflashfxpÉÏ´«ÍøÒ³£¿
Êï¹âÔÆÕ¾|°Ù³Çǧվ|ÕÄÖÝÍøÕ¾½¨Éè|ÕÄÖÝÍøÂ繫˾|ÕÄÖÝÍøÂçÍƹã|ÍøÕ¾½¨É蹫˾|ÆóÒµÍøÕ¾½¨Éè|ÕÄÖÝ×öÍøÕ¾|APPС³ÌÐò|È«ÇòÍÆ
ÕÄÖÝÊÐÊï¹âÍøÂç·þÎñÓÐÏÞ¹«Ë¾ °æȨËùÓР ÁªÏµµØÖ·£ºÕÄÖÝÊÐÓ­±ö´óµÀ6ºÅͬ»Ô¼ÎÔ°2-101 ÁªÏµµç»°£º0596-2952709 13906061801£¨Î¢ÐÅͬºÅ£©

Copyright © 2003-2021 www.35net.com All rights reserved   ±¸°¸ºÅ£ºÃöICP±¸07502426ºÅ   Ãö¹«Íø°²±¸ 35060202000035ºÅ

ÒÔÏÂjsΪ²âÊÔÐÅÏ¢