{"id":49604,"date":"2024-10-08T05:58:13","date_gmt":"2024-10-07T21:58:13","guid":{"rendered":"https:\/\/server.hk\/cnblog\/49604\/"},"modified":"2024-10-08T05:58:13","modified_gmt":"2024-10-07T21:58:13","slug":"iis-7-asp-access-%e4%bd%bf%e7%94%a8%e7%92%b0%e5%a2%83%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/49604\/","title":{"rendered":"IIS 7 ASP + Access \u4f7f\u7528\u74b0\u5883\u914d\u7f6e"},"content":{"rendered":"<h1 id=\"iis-7-asp-access-%e4%bd%bf%e7%94%a8%e7%92%b0%e5%a2%83%e9%85%8d%e7%bd%ae-eJxlcEaaNm\">IIS 7 ASP + Access \u4f7f\u7528\u74b0\u5883\u914d\u7f6e<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u7db2\u7d61\u74b0\u5883\u4e2d\uff0c\u8a31\u591a\u958b\u767c\u8005\u9078\u64c7\u4f7f\u7528 Microsoft \u7684 Internet Information Services (IIS) \u4f86\u90e8\u7f72\u5176 ASP \u61c9\u7528\u7a0b\u5f0f\u3002IIS 7 \u662f\u4e00\u500b\u529f\u80fd\u5f37\u5927\u7684\u7db2\u9801\u4f3a\u670d\u5668\uff0c\u652f\u6301\u591a\u7a2e\u6280\u8853\uff0c\u5305\u62ec ASP \u548c Microsoft Access \u6578\u64da\u5eab\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728 IIS 7 \u4e0a\u914d\u7f6e ASP \u548c Access \u7684\u4f7f\u7528\u74b0\u5883\u3002<\/p>\n<h2 id=\"%e7%92%b0%e5%a2%83%e9%9c%80%e6%b1%82-eJxlcEaaNm\">\u74b0\u5883\u9700\u6c42<\/h2>\n<p>\u5728\u958b\u59cb\u914d\u7f6e\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u78ba\u4fdd\u60a8\u7684\u4f3a\u670d\u5668\u6eff\u8db3\u4ee5\u4e0b\u8981\u6c42\uff1a<\/p>\n<ul>\n<li>\u5b89\u88dd Windows Server 2008 \u6216\u66f4\u9ad8\u7248\u672c\u3002<\/li>\n<li>\u5b89\u88dd IIS 7 \u53ca\u5176\u76f8\u95dc\u529f\u80fd\u3002<\/li>\n<li>\u5b89\u88dd Microsoft Access Database Engine\u3002<\/li>\n<\/ul>\n<h2 id=\"iis-7-%e7%9a%84%e5%ae%89%e8%a3%9d%e8%88%87%e9%85%8d%e7%bd%ae-eJxlcEaaNm\">IIS 7 \u7684\u5b89\u88dd\u8207\u914d\u7f6e<\/h2>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u5728 Windows Server \u4e0a\u5b89\u88dd IIS 7\u3002\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u6b65\u9a5f\u9032\u884c\u5b89\u88dd\uff1a<\/p>\n<ol>\n<li>\u6253\u958b\u300c\u4f3a\u670d\u5668\u7ba1\u7406\u54e1\u300d\u3002<\/li>\n<li>\u9078\u64c7\u300c\u6dfb\u52a0\u89d2\u8272\u300d\u3002<\/li>\n<li>\u5728\u89d2\u8272\u5411\u5c0e\u4e2d\uff0c\u9078\u64c7\u300cWeb \u4f3a\u670d\u5668 (IIS)\u300d\u3002<\/li>\n<li>\u6309\u7167\u5411\u5c0e\u7684\u6307\u793a\u5b8c\u6210\u5b89\u88dd\u3002<\/li>\n<\/ol>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u901a\u904e\u700f\u89bd\u5668\u8a2a\u554f <code>http:\/\/localhost<\/code> \u4f86\u6aa2\u67e5 IIS \u662f\u5426\u6b63\u5e38\u904b\u884c\u3002<\/p>\n<h2 id=\"%e5%95%9f%e7%94%a8-asp-%e6%94%af%e6%8c%81-eJxlcEaaNm\">\u555f\u7528 ASP \u652f\u6301<\/h2>\n<p>\u5728 IIS 7 \u4e2d\uff0c\u9ed8\u8a8d\u60c5\u6cc1\u4e0b ASP \u529f\u80fd\u662f\u7981\u7528\u7684\u3002\u8981\u555f\u7528 ASP\uff0c\u8acb\u6309\u7167\u4ee5\u4e0b\u6b65\u9a5f\u64cd\u4f5c\uff1a<\/p>\n<ol>\n<li>\u5728\u300c\u4f3a\u670d\u5668\u7ba1\u7406\u54e1\u300d\u4e2d\uff0c\u9078\u64c7\u300c\u89d2\u8272\u300d\u4e0b\u7684\u300cWeb \u4f3a\u670d\u5668 (IIS)\u300d\u3002<\/li>\n<li>\u9ede\u64ca\u300c\u89d2\u8272\u670d\u52d9\u300d\uff0c\u7136\u5f8c\u9078\u64c7\u300c\u6dfb\u52a0\u89d2\u8272\u670d\u52d9\u300d\u3002<\/li>\n<li>\u5728\u5217\u8868\u4e2d\u627e\u5230\u300cASP\u300d\uff0c\u52fe\u9078\u4e26\u5b89\u88dd\u3002<\/li>\n<\/ol>\n<h2 id=\"%e9%85%8d%e7%bd%ae-access-%e6%95%b8%e6%93%9a%e5%ba%ab-eJxlcEaaNm\">\u914d\u7f6e Access \u6578\u64da\u5eab<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u914d\u7f6e Access \u6578\u64da\u5eab\u4ee5\u4fbf\u8207 ASP \u61c9\u7528\u7a0b\u5f0f\u4e00\u8d77\u4f7f\u7528\u3002\u4ee5\u4e0b\u662f\u914d\u7f6e\u7684\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u5275\u5efa\u4e00\u500b Access \u6578\u64da\u5eab\u6587\u4ef6\uff08\u4f8b\u5982 <code>database.accdb<\/code>\uff09\u3002<\/li>\n<li>\u5c07\u6578\u64da\u5eab\u6587\u4ef6\u653e\u7f6e\u5728 IIS \u7684\u865b\u64ec\u76ee\u9304\u4e2d\uff0c\u4f8b\u5982 <code>C:inetpubwwwrootmyapp<\/code>\u3002<\/li>\n<li>\u78ba\u4fdd IIS \u7528\u6236\uff08\u901a\u5e38\u662f <code>IUSR<\/code>\uff09\u5c0d\u8a72\u6587\u4ef6\u593e\u64c1\u6709\u8b80\u53d6\u548c\u5beb\u5165\u7684\u6b0a\u9650\u3002<\/li>\n<\/ol>\n<h2 id=\"%e7%b7%a8%e5%af%ab-asp-%e7%a8%8b%e5%bc%8f%e7%a2%bc-eJxlcEaaNm\">\u7de8\u5beb ASP \u7a0b\u5f0f\u78bc<\/h2>\n<p>\u4ee5\u4e0b\u662f\u4e00\u500b\u7c21\u55ae\u7684 ASP \u7a0b\u5f0f\u78bc\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u9023\u63a5\u5230 Access \u6578\u64da\u5eab\u4e26\u57f7\u884c\u67e5\u8a62\uff1a<\/p>\n<pre><code>\n&lt;%\nDim conn, rs, sql\nSet conn = Server.CreateObject(&quot;ADODB.Connection&quot;)\nSet rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)\n\n&#039; \u9023\u63a5\u5b57\u7b26\u4e32\nconn.Open &quot;Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:inetpubwwwrootmyappdatabase.accdb;&quot;\n\n&#039; SQL \u67e5\u8a62\nsql = &quot;SELECT * FROM myTable&quot;\nrs.Open sql, conn\n\n&#039; \u8f38\u51fa\u7d50\u679c\nDo While Not rs.EOF\n    Response.Write rs(&quot;columnName&quot;) &amp; &quot;<br>\"\n    rs.MoveNext\nLoop\n\n' \u95dc\u9589\u9023\u63a5\nrs.Close\nconn.Close\nSet rs = Nothing\nSet conn = Nothing\n%&gt;\n<\/code><\/pre>\n<h2 id=\"%e6%b8%ac%e8%a9%a6%e6%87%89%e7%94%a8%e7%a8%8b%e5%bc%8f-eJxlcEaaNm\">\u6e2c\u8a66\u61c9\u7528\u7a0b\u5f0f<\/h2>\n<p>\u5b8c\u6210\u4e0a\u8ff0\u6b65\u9a5f\u5f8c\uff0c\u60a8\u53ef\u4ee5\u901a\u904e\u700f\u89bd\u5668\u8a2a\u554f\u60a8\u7684 ASP \u61c9\u7528\u7a0b\u5f0f\uff0c\u4f8b\u5982 <code>http:\/\/localhost\/myapp\/test.asp<\/code>\uff0c\u4f86\u6e2c\u8a66\u662f\u5426\u80fd\u6210\u529f\u9023\u63a5\u5230 Access \u6578\u64da\u5eab\u4e26\u986f\u793a\u6578\u64da\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-eJxlcEaaNm\">\u7e3d\u7d50<\/h2>\n<p>\u5728 IIS 7 \u4e0a\u914d\u7f6e ASP \u548c Access \u74b0\u5883\u4e26\u4e0d\u8907\u96dc\uff0c\u53ea\u9700\u9075\u5faa\u4e0a\u8ff0\u6b65\u9a5f\u5373\u53ef\u3002\u9019\u7a2e\u914d\u7f6e\u9069\u5408\u5c0f\u578b\u61c9\u7528\u7a0b\u5f0f\u548c\u958b\u767c\u74b0\u5883\u3002\u5982\u679c\u60a8\u9700\u8981\u66f4\u9ad8\u6548\u80fd\u7684\u89e3\u6c7a\u65b9\u6848\uff0c\u53ef\u4ee5\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2f VPS<\/a> \u670d\u52d9\uff0c\u9019\u6a23\u53ef\u4ee5\u7372\u5f97\u66f4\u597d\u7684\u8cc7\u6e90\u7ba1\u7406\u548c\u64f4\u5c55\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to configure IIS 7 for ASP applications using Access databases, ensuring optimal performance and seamless integration.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-49604","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=49604"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49604\/revisions"}],"predecessor-version":[{"id":49605,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49604\/revisions\/49605"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=49604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=49604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=49604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}