{"id":173,"date":"2010-07-10T15:09:26","date_gmt":"2010-07-10T07:09:26","guid":{"rendered":"http:\/\/www.xiaojia.info\/?p=173"},"modified":"2010-07-10T15:12:11","modified_gmt":"2010-07-10T07:12:11","slug":"aspaccess","status":"publish","type":"post","link":"https:\/\/www.luja.cc\/?p=173","title":{"rendered":"asp+access\u5b58\u50a8\u8fc7\u7a0b\u4f7f\u7528\u6a21\u7cca\u67e5\u8be2\u95ee\u9898"},"content":{"rendered":"<p>\u4eca\u5929\uff0c\u7528access\u7684\u5b58\u50a8\u8fc7\u7a0b(\u4e5f\u8c08\u4e0d\u4e0a\u662f\u5b58\u50a8\u8fc7\u7a0b\uff0c\u53ea\u662faccess\u7684\u67e5\u8be2\u8bbe\u8ba1\u5668)\u5b9e\u73b0\u6a21\u7cca\u67e5\u8be2\u3002<br \/>\naccess\u7684\u67e5\u8be2\u8bed\u53e5\u5982\u4e0b\uff1a<br \/>\n[code]<br \/>\nSELECT *<br \/>\nFROM company<br \/>\nWHERE company Like &#8216;*&#8217; &amp; [p_company] &amp; &#8216;*&#8217;<br \/>\nORDER BY beian.id DESC;<br \/>\n[\/code]<br \/>\n\u4ee5\u4e0a\u662fgetdata\u5b58\u50a8\u8fc7\u7a0b\u3002<br \/>\n<!--more--><br \/>\nasp\u4f7f\u7528\u5b58\u50a8\u8fc7\u7a0b\u8bed\u53e5\u5982\u4e0b\uff1a<br \/>\n[code]<br \/>\n\tset cmd = server.CreateObject(&quot;ADODB.Command&quot;)<br \/>\n\twith cmd<br \/>\n\t.ActiveConnection = conn<br \/>\n\t.CommandType = &amp;H0004<br \/>\n\t.CommandText = &quot;getdata&quot;<br \/>\n\tend with<br \/>\n\tDim resultRS, resultArray<br \/>\n\tSet resultRS = cmd.Execute(,request(&quot;keyword&quot;))<br \/>\n\tIf Not resultRS.EOF Then<br \/>\n\t\tresultArray = resultRS.GetRows()<br \/>\n\tEnd If<br \/>\n\tSet resultRS = Nothing<br \/>\n\tSet cmd = Nothing<br \/>\n\tconn.Close<br \/>\n\tSet conn = Nothing<br \/>\n[\/code]<\/p>\n<p>\u73b0\u5728\u95ee\u9898\u51fa\u6765\u4e86\uff0cresultRS\u91cc\u9762\u83b7\u53d6\u4e0d\u5230\u4efb\u4f55\u6570\u636e\uff0c\u4e5f\u5c31\u662fcmd.Execute\u6ca1\u6709\u8fd4\u56de\u6570\u636e\u96c6\uff0c\u4f46\u662f\u5728access\u6570\u636e\u5e93\u91cc\u9762\u8f93\u5165\u53d8\u91cf\u540d\uff0c\u5374\u80fd\u83b7\u53d6\u5230\u6570\u636e\uff0c\u5982\u679c\u4f60\u8bb2\u6a21\u7cca\u67e5\u8be2\u6539\u4e3a\u7cbe\u786e\u67e5\u8be2\uff0c\u5374\u80fd\u6b63\u5e38\u83b7\u53d6\u6570\u636e\uff0c\u8fd9\u4f7f\u6211\u5f88\u90c1\u95f7\uff0c\u96be\u9053\u4e0d\u80fd\u4f7f\u7528\u6a21\u7cca\u67e5\u8be2\uff1f<br \/>\n\u5728\u7f51\u4e0a\u627e\u4e86\u5f88\u591a\u8d44\u6599\uff0c\u90fd\u65e0\u679c\uff0c\u81ea\u5df1\u53cd\u590d\u4fee\u6539\u4ee3\u7801\u90fd\u627e\u4e0d\u5230\u539f\u56e0\uff0c\u4f46\u662f\u4e00\u6b21\u65e0\u610f\u7684\u4fee\u6539\uff0c\u5374\u80fd\u83b7\u53d6\u5230\u4e86\u6570\u636e\uff0c\u90a3\u5c31\u662f\u5728\u6253\u5f00\u6570\u636e\u5e93\u8fde\u63a5\u7684\u8bed\u53e5\u3002<br \/>\n\u5728conn.asp\u91cc\u9762\u662f\u8fd9\u6837\u7684\u3002<br \/>\n[code]<br \/>\n&lt;%<br \/>\ndim conn<br \/>\ndim connstr<br \/>\ndim db<br \/>\ndb=&quot;db\/#beian.mdb&quot;<br \/>\nSet conn = Server.CreateObject(&quot;adodb.connection&quot;)<br \/>\nconnstr=&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot; &amp; Server.MapPath(db)<br \/>\n&#8216;\u5982\u679c\u4f60\u7684\u670d\u52a1\u5668\u91c7\u7528\u8f83\u8001\u7248\u672cAccess\u9a71\u52a8\uff0c\u8bf7\u7528\u4e0b\u9762\u8fde\u63a5\u65b9\u6cd5<br \/>\n&#8216;connstr=&quot;driver={Microsoft Access Driver (*.mdb)};dbq=&quot; &amp; Server.MapPath(db)<br \/>\nconn.Open connstr<br \/>\n%&gt;<br \/>\n[\/code]<br \/>\n\u539f\u56e0\u5728\u4e8econnstr\u8fd9\u4e2a\u6253\u5f00\u6570\u636e\u5e93\u8fde\u63a5\u8bed\u53e5\uff0c<br \/>\n\u5982\u679c\u4f7f\u7528connstr=&#8221;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&#8221; &#038; Server.MapPath(db)\u8fd9\u4e2a\u8bed\u53e5\uff0c\u6a21\u7cca\u67e5\u8be2\u5c31\u83b7\u53d6\u4e0d\u5230\u6570\u636e\u3002<br \/>\n\u5982\u679c\u6539\u4e3a\u4e0b\u9762\u7684\u90a3\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\u8bed\u53e5\uff0c\u5c31\u80fd\u67e5\u8be2\u5230\u6570\u636e\uff0c\u539f\u7406\uff0c\u6211\u4e0d\u61c2\uff0c\u53ea\u77e5\u9053\u95ee\u9898\u51fa\u5728\u8fd9\u513f\u3002\u5982\u679c\u5927\u5bb6\u77e5\u9053\u5176\u4e2d\u7684\u539f\u7406\uff0c\u8bf7\u5e16\u51fa\u6765\uff0c\u4e00\u8d77\u4e86\u89e3\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\uff0c\u7528access\u7684\u5b58\u50a8\u8fc7\u7a0b(\u4e5f\u8c08\u4e0d\u4e0a\u662f\u5b58\u50a8\u8fc7\u7a0b\uff0c\u53ea\u662faccess\u7684\u67e5\u8be2\u8bbe\u8ba1\u5668)\u5b9e\u73b0\u6a21\u7cca\u67e5\u8be2\u3002 access &hellip;<br \/><a href=\"https:\/\/www.luja.cc\/?p=173\">Read more <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11,23],"tags":[24,173,36],"_links":{"self":[{"href":"https:\/\/www.luja.cc\/index.php?rest_route=\/wp\/v2\/posts\/173"}],"collection":[{"href":"https:\/\/www.luja.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.luja.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.luja.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.luja.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=173"}],"version-history":[{"count":2,"href":"https:\/\/www.luja.cc\/index.php?rest_route=\/wp\/v2\/posts\/173\/revisions"}],"predecessor-version":[{"id":175,"href":"https:\/\/www.luja.cc\/index.php?rest_route=\/wp\/v2\/posts\/173\/revisions\/175"}],"wp:attachment":[{"href":"https:\/\/www.luja.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.luja.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.luja.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}