ÂÛÎÄÎÞÓÇÍøÌṩ£º¼ÆËã»ú±ÏÒµÂÛÎÄ·¶ÎÄ|¼ÆËã»ú±ÏÒµÉè¼Æ|¼ÆËã»ú±ÏÒµÂÛÎÄ
À¸Ä¿µ¼º½ ASP Java Web .NET VB6.0 JAVA VC VF DELPHI PB ¼ÆËã»úÍøÂç ¼ÆËã»ú¿ÆѧÓë¼¼Êõ PHP °²×¿APP ÆäËû C# ´úдÂÛÎÄ
µ±Ç°Î»ÖÃ: > ¼ÆËã»ú > ASP >

A450ͬѧ¼

 4.3 Êý¾Ý¿âʵÏÖ

±¾ÏµÍ³²¢Ã»Óн«Êý¾Ý¿âÁ¬½Ó³ÌÐòµ¥¶À·ÅÈëÒ»Ò³£¬¾ßÌå³ÌÐòÈçÏ£º ÄÚÈÝÀ´×ÔÂÛÎÄÎÞÓÇÍø www.paper51.com

 <%

ÄÚÈÝÀ´×ÔÂÛÎÄÎÞÓÇÍø www.paper51.com

dim db

http://www.paper51.com

set db=server.createobject("adodb.connection") ÄÚÈÝÀ´×Ôwww.paper51.com

db.open "driver={microsoft access driver (*.mdb)};

copyright paper51.com

dbq=" & server.MapPath(".../data/yhzc.mdb") copyright paper51.com

%> http://www.paper51.com

 ÕÕƬÊý¾Ý¿âÁ¬½Ó³ÌÐò£º http://www.paper51.com

<% copyright paper51.com

dim db ÄÚÈÝÀ´×ÔÂÛÎÄÎÞÓÇÍø www.paper51.com

set db=server.createobject("adodb.connection")

ÄÚÈÝÀ´×Ôwww.paper51.com

db.open "driver={microsoft access driver (*.mdb)}; paper51.com

dbq=" & server.MapPath(".../data/yhzc.mdb") copyright paper51.com

%> http://www.paper51.com

4.3.1´´½¨Êý¾Ý¿âÁ´½Ó(Connection) ÄÚÈÝÀ´×Ôwww.paper51.com

Á´½ÓÓÃÒÔ±£³ÖһЩ¹ØÓÚÕýÔÚ·ÃÎʵÄÊý¾ÝµÄһЩ״̬ÐÅÏ¢£¬ÒÔ¼°Á´½ÓÕßÐÅÏ¢¡£ASPÎļþÖÐÈç¹ûÒª·ÃÎÊÊý¾Ý£¬±ØÐëÊ×ÏÈ´´½¨ÓëÊý¾Ý¿âµÄÁ´½Ó£¬ÆäÓï·¨ÈçÏ£º ÄÚÈÝÀ´×Ôwww.paper51.com

setConn=Server.createObject(“ADOBD.CONNECTION”)

copyright paper51.com

ÕâÌõÓï¾ä´´½¨ÁËÁ´½Ó¶ÔÏóConn£¬½ÓÏÂÀ´£º

ÄÚÈÝÀ´×Ôwww.paper51.com

connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data.Source="&Server.MapPath(""&db&"")

paper51.com

conn.Open connstr http://www.paper51.com

ÕâÌõÓï¾ä´ò¿ªÁ´½Ó£¬Óõ½ÁËDSN£¬±¾ÀýΪ“connstr”¡£ http://www.paper51.com

ÒÔÉÏÁ½¸ö²½Öèȱһ²»¿É£¬ÒòΪÁ´½Ó¶ÔÏóµÄ´´½¨Óë´ò¿ªÊÇÁ½»ØÊ£¬Ö»Óдò¿ªÁ˲ÅÕæÕý¿ÉÒÔʹÓᣠÄÚÈÝÀ´×Ôwww.paper51.com

4.3.2´´½¨Êý¾Ý¶ÔÏó(Record Set)

http://www.paper51.com

ADOÖеÄÊý¾Ý¶ÔÏóͨ³£±£´æµÄÊDzéѯ½á¹û¡£Record SetÊÇADOÖÐ×ÔӵĶÔÏó£¬ÓÐÐí¶àÊôÐԺͷ½·¨¡£Record Set±£´æµÄÊÇÒ»ÐÐÐеļǼ£¬²¢±êÓÐÒ»¸öµ±Ç°¼Ç¼¡£ÒÔÏÂÊÇ´´½¨·½·¨£º

ÄÚÈÝÀ´×Ôwww.paper51.com

Set Record Set=Conn.Execute(sqtStr) ÄÚÈÝÀ´×ÔÂÛÎÄÎÞÓÇÍø www.paper51.com

ÕâÌõÓï¾ä´´½¨²¢´ò¿ªÁ˶ÔÏóRecord Set£¬ÆäÖÐConÊÇÏÈÇ°´´½¨µÄÁ´½Ó¶ÔÏó£¬rsÊÇÒ»¸ö×Ö´®£¬´ú±íÒ»Ìõ±ê×¼µÄSQLÓï¾ä¡£ÀýÈ磺 ÄÚÈÝÀ´×ÔÂÛÎÄÎÞÓÇÍø www.paper51.com

rs=“SELECT * FROM shop_books” ÄÚÈÝÀ´×Ôwww.paper51.com

Set Record Set=mConn.Execute(rs)

paper51.com

ÕâÌõÓï¾äÖ´Ðк󣬶ÔÏóRecord SetÖоͱ£´æÁ˱ítab1ÖеÄËùÓмǼ¡£ copyright paper51.com

×¢Ò⣺Êý¾Ý¿âÎļþÔÚ±¾ÏµÍ³µÄxyl/dateÎļþ¼ÐÖС£ copyright paper51.com

ÍøÓÑ×¢²áÄ£¿é paper51.com

ÍøÓÑ×¢²áÄ£¿é°üº¬ÒÔÏÂ×ÓÄ£¿é¡£ paper51.com

l       »áÔ±×¢²á ÄÚÈÝÀ´×Ôwww.paper51.com

n           yhzc.htm paper51.com

n           yhzc.asp copyright paper51.com

n           yhbrow.asp ÄÚÈÝÀ´×Ôwww.paper51.com

n           datj.asp

http://www.paper51.com

l       Óû§µÇ¼

paper51.com

n           default.asp paper51.com

n           yhdl.asp ÄÚÈÝÀ´×ÔÂÛÎÄÎÞÓÇÍø www.paper51.com

n           wdda.asp

http://www.paper51.com

¸÷Ò³ÃæµÄ¹ØϵÈçͼËùʾ

ÄÚÈÝÀ´×Ôwww.paper51.com

------·Ö¸ôÏß----------------------------
ÁªÏµ·½Ê½