{"id":140948,"date":"2024-10-31T21:09:12","date_gmt":"2024-10-31T13:09:12","guid":{"rendered":"https:\/\/server.hk\/cnblog\/140948\/"},"modified":"2024-10-31T21:09:13","modified_gmt":"2024-10-31T13:09:13","slug":"sql-server-%e8%88%87-access-%e6%95%b8%e6%93%9a%e5%ba%ab-asp-%e4%bb%a3%e7%a2%bc%e7%9a%84%e6%af%94%e8%bc%83%e8%a9%b3%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/140948\/","title":{"rendered":"SQL Server \u8207 Access \u6578\u64da\u5eab ASP \u4ee3\u78bc\u7684\u6bd4\u8f03\u8a73\u89e3"},"content":{"rendered":"<h1 id=\"sql-server-%e8%88%87-access-%e6%95%b8%e6%93%9a%e5%ba%ab-asp-%e4%bb%a3%e7%a2%bc%e7%9a%84%e6%af%94%e8%bc%83%e8%a9%b3%e8%a7%a3-xCQpTcZAcP\">SQL Server \u8207 Access \u6578\u64da\u5eab ASP \u4ee3\u78bc\u7684\u6bd4\u8f03\u8a73\u89e3<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u6578\u64da\u9a45\u52d5\u6642\u4ee3\uff0c\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\u5c0d\u65bc\u958b\u767c\u8005\u548c\u4f01\u696d\u81f3\u95dc\u91cd\u8981\u3002SQL Server \u548c Microsoft Access \u662f\u5169\u7a2e\u5e38\u898b\u7684\u6578\u64da\u5eab\u89e3\u6c7a\u65b9\u6848\uff0c\u5404\u81ea\u64c1\u6709\u4e0d\u540c\u7684\u7279\u9ede\u548c\u9069\u7528\u5834\u666f\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u9019\u5169\u8005\u5728 ASP \u4ee3\u78bc\u4e2d\u7684\u61c9\u7528\u53ca\u5176\u512a\u7f3a\u9ede\u3002<\/p>\n<h2 id=\"sql-server-%e7%b0%a1%e4%bb%8b-xCQpTcZAcP\">SQL Server \u7c21\u4ecb<\/h2>\n<p>SQL Server \u662f\u5fae\u8edf\u63a8\u51fa\u7684\u4e00\u6b3e\u95dc\u806f\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u4e3b\u8981\u7528\u65bc\u5927\u578b\u4f01\u696d\u548c\u9ad8\u8ca0\u8f09\u7684\u61c9\u7528\u7a0b\u5e8f\u3002\u5b83\u652f\u6301\u591a\u7528\u6236\u74b0\u5883\uff0c\u4e26\u63d0\u4f9b\u5f37\u5927\u7684\u6578\u64da\u8655\u7406\u80fd\u529b\u548c\u5b89\u5168\u6027\u3002<\/p>\n<h3 id=\"%e7%89%b9%e9%bb%9e-xCQpTcZAcP\">\u7279\u9ede<\/h3>\n<ul>\n<li><strong>\u53ef\u64f4\u5c55\u6027\uff1a<\/strong>SQL Server \u80fd\u5920\u8655\u7406\u5927\u91cf\u6578\u64da\uff0c\u9069\u5408\u5927\u578b\u61c9\u7528\u3002<\/li>\n<li><strong>\u5b89\u5168\u6027\uff1a<\/strong>\u63d0\u4f9b\u591a\u5c64\u6b21\u7684\u5b89\u5168\u6a5f\u5236\uff0c\u5305\u62ec\u7528\u6236\u8eab\u4efd\u9a57\u8b49\u548c\u6578\u64da\u52a0\u5bc6\u3002<\/li>\n<li><strong>\u9ad8\u53ef\u7528\u6027\uff1a<\/strong>\u652f\u6301\u6578\u64da\u5eab\u93e1\u50cf\u548c\u6545\u969c\u8f49\u79fb\u96c6\u7fa4\uff0c\u78ba\u4fdd\u7cfb\u7d71\u7684\u7a69\u5b9a\u6027\u3002<\/li>\n<\/ul>\n<h3 id=\"asp-%e4%bb%a3%e7%a2%bc%e7%a4%ba%e4%be%8b-xCQpTcZAcP\">ASP \u4ee3\u78bc\u793a\u4f8b<\/h3>\n<pre><code>\n&lt;%\nDim conn, rs, sql\nSet conn = Server.CreateObject(&quot;ADODB.Connection&quot;)\nconn.Open &quot;Provider=SQLOLEDB;Data Source=your_server;Initial Catalog=your_database;User ID=your_username;Password=your_password;&quot;\nsql = &quot;SELECT * FROM your_table&quot;\nSet rs = conn.Execute(sql)\n\nDo While Not rs.EOF\n    Response.Write rs(&quot;column_name&quot;) &amp; &quot;<br>\"\n    rs.MoveNext\nLoop\n\nrs.Close\nconn.Close\n%&gt;\n<\/code><\/pre>\n<h2 id=\"access-%e7%b0%a1%e4%bb%8b-xCQpTcZAcP\">Access \u7c21\u4ecb<\/h2>\n<p>Microsoft Access \u662f\u4e00\u6b3e\u684c\u9762\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u9069\u5408\u5c0f\u578b\u61c9\u7528\u548c\u500b\u4eba\u4f7f\u7528\u3002\u5b83\u7684\u754c\u9762\u53cb\u597d\uff0c\u6613\u65bc\u4f7f\u7528\uff0c\u7279\u5225\u9069\u5408\u4e0d\u5177\u5099\u6df1\u539a\u6280\u8853\u80cc\u666f\u7684\u7528\u6236\u3002<\/p>\n<h3 id=\"%e7%89%b9%e9%bb%9e-xCQpTcZAcP\">\u7279\u9ede<\/h3>\n<ul>\n<li><strong>\u6613\u65bc\u4f7f\u7528\uff1a<\/strong>Access \u63d0\u4f9b\u76f4\u89c0\u7684\u7528\u6236\u754c\u9762\uff0c\u65b9\u4fbf\u7528\u6236\u5feb\u901f\u4e0a\u624b\u3002<\/li>\n<li><strong>\u96c6\u6210\u6027\uff1a<\/strong>\u8207\u5176\u4ed6 Microsoft Office \u61c9\u7528\u7a0b\u5e8f\uff08\u5982 Excel \u548c Word\uff09\u7121\u7e2b\u96c6\u6210\u3002<\/li>\n<li><strong>\u6210\u672c\u6548\u76ca\uff1a<\/strong>\u5c0d\u65bc\u5c0f\u578b\u4f01\u696d\u6216\u500b\u4eba\u7528\u6236\uff0cAccess \u7684\u6210\u672c\u76f8\u5c0d\u8f03\u4f4e\u3002<\/li>\n<\/ul>\n<h3 id=\"asp-%e4%bb%a3%e7%a2%bc%e7%a4%ba%e4%be%8b-xCQpTcZAcP\">ASP \u4ee3\u78bc\u793a\u4f8b<\/h3>\n<pre><code>\n&lt;%\nDim conn, rs, sql\nSet conn = Server.CreateObject(&quot;ADODB.Connection&quot;)\nconn.Open &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=your_database.mdb;&quot;\nsql = &quot;SELECT * FROM your_table&quot;\nSet rs = conn.Execute(sql)\n\nDo While Not rs.EOF\n    Response.Write rs(&quot;column_name&quot;) &amp; &quot;<br>\"\n    rs.MoveNext\nLoop\n\nrs.Close\nconn.Close\n%&gt;\n<\/code><\/pre>\n<h2 id=\"sql-server-%e8%88%87-access-%e7%9a%84%e6%af%94%e8%bc%83-xCQpTcZAcP\">SQL Server \u8207 Access \u7684\u6bd4\u8f03<\/h2>\n<p>\u5728\u9078\u64c7 SQL Server \u6216 Access \u6642\uff0c\u958b\u767c\u8005\u9700\u8981\u8003\u616e\u591a\u500b\u56e0\u7d20\uff0c\u5305\u62ec\u6578\u64da\u91cf\u3001\u7528\u6236\u6578\u91cf\u3001\u9810\u7b97\u548c\u61c9\u7528\u9700\u6c42\u3002<\/p>\n<h3 id=\"%e6%80%a7%e8%83%bd-xCQpTcZAcP\">\u6027\u80fd<\/h3>\n<p>SQL Server \u5728\u8655\u7406\u5927\u91cf\u6578\u64da\u548c\u9ad8\u4e26\u767c\u7528\u6236\u6642\u8868\u73fe\u66f4\u4f73\uff0c\u800c Access \u66f4\u9069\u5408\u5c0f\u578b\u6578\u64da\u96c6\u548c\u5c11\u91cf\u7528\u6236\u3002<\/p>\n<h3 id=\"%e5%ae%89%e5%85%a8%e6%80%a7-xCQpTcZAcP\">\u5b89\u5168\u6027<\/h3>\n<p>SQL Server \u63d0\u4f9b\u66f4\u9ad8\u7684\u5b89\u5168\u6027\u548c\u6578\u64da\u4fdd\u8b77\u63aa\u65bd\uff0c\u800c Access \u7684\u5b89\u5168\u6027\u76f8\u5c0d\u8f03\u4f4e\uff0c\u9069\u5408\u4e0d\u9700\u8981\u9ad8\u5b89\u5168\u6027\u7684\u61c9\u7528\u3002<\/p>\n<h3 id=\"%e9%96%8b%e7%99%bc%e5%92%8c%e7%b6%ad%e8%ad%b7-xCQpTcZAcP\">\u958b\u767c\u548c\u7dad\u8b77<\/h3>\n<p>SQL Server \u7684\u958b\u767c\u548c\u7dad\u8b77\u9700\u8981\u66f4\u9ad8\u7684\u6280\u8853\u6c34\u5e73\uff0c\u800c Access \u7684\u4f7f\u7528\u548c\u7dad\u8b77\u76f8\u5c0d\u7c21\u55ae\uff0c\u9069\u5408\u975e\u6280\u8853\u7528\u6236\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-xCQpTcZAcP\">\u7e3d\u7d50<\/h2>\n<p>\u7e3d\u7684\u4f86\u8aaa\uff0cSQL Server \u548c Access \u5404\u6709\u5176\u512a\u7f3a\u9ede\uff0c\u9078\u64c7\u54ea\u4e00\u7a2e\u6578\u64da\u5eab\u53d6\u6c7a\u65bc\u5177\u9ad4\u7684\u61c9\u7528\u9700\u6c42\u548c\u9810\u7b97\u3002\u5982\u679c\u60a8\u9700\u8981\u8655\u7406\u5927\u91cf\u6578\u64da\u4e26\u4e14\u9700\u8981\u9ad8\u5b89\u5168\u6027\uff0cSQL Server \u662f\u66f4\u597d\u7684\u9078\u64c7\uff1b\u800c\u5982\u679c\u60a8\u662f\u5c0f\u578b\u4f01\u696d\u6216\u500b\u4eba\u7528\u6236\uff0cAccess \u53ef\u80fd\u66f4\u7b26\u5408\u60a8\u7684\u9700\u6c42\u3002\u7121\u8ad6\u60a8\u9078\u64c7\u54ea\u7a2e\u6578\u64da\u5eab\uff0c\u78ba\u4fdd\u60a8\u7684\u61c9\u7528\u7a0b\u5e8f\u80fd\u5920\u6709\u6548\u5730\u7ba1\u7406\u548c\u5229\u7528\u6578\u64da\u662f\u6700\u91cd\u8981\u7684\u3002<\/p>\n<p>\u5982\u9700\u4e86\u89e3\u66f4\u591a\u6709\u95dc <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u548c\u6578\u64da\u5eab\u89e3\u6c7a\u65b9\u6848\u7684\u4fe1\u606f\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6bd4\u8f03 SQL Server \u8207 Access \u6578\u64da\u5eab\u5728 ASP \u4ee3\u78bc\u4e2d\u7684\u61c9\u7528\uff0c\u6df1\u5165\u5206\u6790\u6027\u80fd\u3001\u529f\u80fd\u53ca\u9069\u7528\u5834\u666f\u7684\u5dee\u7570\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-140948","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/140948","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"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=140948"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/140948\/revisions"}],"predecessor-version":[{"id":140957,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/140948\/revisions\/140957"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=140948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=140948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=140948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}