Ö£ÖÝÍøÕ¾½¨ÉèʼÓÚ2004Ä꣡QQ×Éѯ£º12269363 ÁªÏµµç»°£º0371-56688798 ÊÖ»ú£º13643860807 µÇ¼  ×¢²á  ÐÂÎÅÖÐÐÄ   ¿Í»§Ö§³Ö   ½»·Ñ·½Ê½   ÁªÏµÎÒÃÇ

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

·¢²¼Ê±¼ä:2006-04-18 22:57:40   ä¯ÀÀÈËÊý: 478040 ´Î  
  ¹Ø¼ü×Ö: 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ÉÏ´«ÍøÒ³£¿
µç»°£º0371-56688798  ÊÖ»ú£º13643860807
QQ£º12269363 Email£ºzzqqwl@zzqqwl.com ±¸°¸ºÅ£ºÔ¥ICP±¸14014950ºÅ
Ö£ÖÝǧÇïÍøÂç¿Æ¼¼ÓÐÏÞ¹«Ë¾ °æȨËùÓÐ ±¾Õ¾³ÌÐò½çÃæ¡¢Ô´´úÂëÊÜÏà¹Ø·¨Âɱ£»¤£¬Î´¾­ÊÚȨ£¬ÑϽûʹÓÃ
Copyright © 2004-2020 www.zzqqwl.com. All rights reserved 
ÒÔÏÂjsΪ²âÊÔÐÅÏ¢