{"id":2204,"date":"2020-06-09T19:36:04","date_gmt":"2020-06-09T11:36:04","guid":{"rendered":"https:\/\/www.wesbytes.com\/guide\/?post_type=kb&#038;p=2204"},"modified":"2026-03-17T14:22:57","modified_gmt":"2026-03-17T06:22:57","slug":"access-database-connection-string","status":"publish","type":"kb","link":"https:\/\/www.servergigabit.com\/guide\/kb\/access-database-connection-string","title":{"rendered":"Connect to MS Access Database"},"content":{"rendered":"<h3><b>You can use sample code below to connect to your MS Access database:<\/b><\/h3>\n<table id=\"table2\" border=\"1\" width=\"530\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr bgcolor=\"#ccccff\">\n<td style=\"text-align: center;\"><b>Connection String<\/b><\/td>\n<\/tr>\n<tr bgcolor=\"#ffffea\">\n<td style=\"text-align: center;\">\u201cProvider=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};\u201d &amp;_<br \/>\n\u201cUID=;PWD=YourPassword;\u201d &amp;_<br \/>\n\u201cDBQ=DatabasePhysicalPath;\u201d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>ConnectionString = \u201cProvider=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};\u201d &amp;_<br \/>\n\u201cUID=;PWD=SamplePassword;\u201d &amp;_<br \/>\n\u201cDBQ=C:\\Domains\\sample.net\\db\\sample.mdb;\u201d<\/p>\n<p dir=\"ltr\">Set Conn = Server.CreateObject(\u201cADODB.Connection\u201d)<br \/>\nConn.ConnectionString = ConnectionString<br \/>\nConn.Open<\/p>\n<p dir=\"ltr\"><em>Please refer to the following article to know more.\u00a0<\/em><br \/>\n<strong>Knowledge Base: <\/strong><a href=\"https:\/\/www.servergigabit.com\/guide\/kb\/connection-string-for-ms-access\/\">Connection String for MS Access<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can use sample code below to connect to your MS Access database: Connection String \u201cProvider=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};\u201d &amp;_ \u201cUID=;PWD=YourPassword;\u201d &amp;_ \u201cDBQ=DatabasePhysicalPath;\u201d ConnectionString = \u201cProvider=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};\u201d &amp;_ \u201cUID=;PWD=SamplePassword;\u201d &amp;_ \u201cDBQ=C:\\Domains\\sample.net\\db\\sample.mdb;\u201d Set Conn = Server.CreateObject(\u201cADODB.Connection\u201d) Conn.ConnectionString = ConnectionString Conn.Open Please refer to the following article to know more.\u00a0 Knowledge Base: Connection String for MS Access<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"kbtopic":[54],"kbtag":[1291],"class_list":["post-2204","kb","type-kb","status-publish","hentry","kbtopic-microsoft-access","kbtag-ms-access-databasems-access-database"],"_links":{"self":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/2204","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/comments?post=2204"}],"version-history":[{"count":6,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/2204\/revisions"}],"predecessor-version":[{"id":6366,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/2204\/revisions\/6366"}],"wp:attachment":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/media?parent=2204"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=2204"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtag?post=2204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}