{"id":7317,"date":"2019-06-29T09:34:55","date_gmt":"2019-06-29T09:34:55","guid":{"rendered":"https:\/\/zappysys.com\/blog\/?p=7317"},"modified":"2024-01-17T11:26:44","modified_gmt":"2024-01-17T11:26:44","slug":"export-rest-api-ms-access-using-vba-command-button","status":"publish","type":"post","link":"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/","title":{"rendered":"How to Export REST API to MS Access using VBA Command Button"},"content":{"rendered":"<h2><span id=\"Introduction\">Introduction<\/span><\/h2>\n<p><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/VBA_250x250.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-7318 size-thumbnail\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/VBA_250x250-150x150.png\" alt=\"VBA\" width=\"150\" height=\"150\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/VBA_250x250-150x150.png 150w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/VBA_250x250.png 250w\" sizes=\"(max-width: 150px) 100vw, 150px\" \/><\/a>In our previous blog we saw how to <a href=\"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/\" target=\"_blank\" rel=\"noopener\">export REST API to CSV using c# or Python<\/a>. In this post we will look at specific example on <strong>How to Export REST API to MS Access using VBA Command Button<\/strong>, along with few other topics such as how to make <strong>REST API Call<\/strong>, how to read all Customers data from Odata using our ODBC JSON Driver and load it into the Ms Access Table.<\/p>\n<p>We will go through the steps to read data from Odata and Load into MS Access using\u00a0VBA Command Button.<\/p>\n<p>In nutshell,\u00a0this post will focus on how to make ODBC Driver Call using VBA.<\/p>\n<p>So let\u2019s get started.<\/p>\n<h2><span id=\"Requirements\">Requirements<\/span><\/h2>\n<ol>\n<li>First of all, you will need\u00a0<a href=\"https:\/\/zappysys.com\/products\/odbc-powerpack\/download\/\" target=\"_blank\" rel=\"noopener\">ZappySys ODBC PowerPack<\/a>\u00a0installed.<\/li>\n<li>Secondly, Make sure that Microsoft Access installed for VBA example.<\/li>\n<\/ol>\n<h2><span id=\"An_introduction_to_Rest_API_and_OData\">An introduction to Rest API and OData<\/span><\/h2>\n<p>In this example, we will use OData (Open Data Protocol) to consume REST API. REST API\u00a0(Representational State Transfer Application Program Interface) allows handling the interoperability between computers and the internet.<\/p>\n<p>In REST API we can handle web services in different formats. In this example, we will work with the Northwind example. The Northwind example is available in this URL:<\/p>\n<div id=\"crayon-5bc180f1dd015720033381\" class=\"crayon-syntax crayon-theme-vs2012 crayon-font-courier-new crayon-os-pc print-yes notranslate\">\n<div class=\"crayon-main\">\n<pre class=\"lang:default decode:true\">https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc<\/pre>\n<\/div>\n<\/div>\n<ol>\n<li>By default, the data is displayed in XML format. To show the data in JSON use this URL:\n<pre class=\"lang:default decode:true \">https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/?$format=json<\/pre>\n<\/li>\n<li>There are collections of data like Categories, CustomerDemographic, Customers, Invoices, etc. For example, the following URL will show the data of the categories collection:\n<pre class=\"lang:default decode:true\">https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/Customers?$format=json<\/pre>\n<\/li>\n<li>In the next steps, we will use ZappySys drivers to connect to this URL and query using OData.<\/li>\n<\/ol>\n<h2><span id=\"Configure_ODBC_DSN_for_ZappySys_JSON_Driver\">Configure ODBC DSN for ZappySys JSON Driver<\/span><\/h2>\n<p>ODBC driver can be accessed in two modes.<\/p>\n<ol>\n<li>Using DSN<\/li>\n<li>Without DSN (Supply direct Connection String e.g.\u00a0<strong>DRIVER={ZappySys JSON Driver}; \u2026\u2026..<\/strong>\u00a0)<\/li>\n<\/ol>\n<p>In this article, we will use the DSN approach (User DSN).\u00a0We will first add the ZappySys JSON Driver in the ODBC Data Source Administrator.<\/p>\n<p>Follow these steps to accomplish the task:<\/p>\n<ol>\n<li>First,\u00a0<strong>Windows search<\/strong>, write\u00a0<strong>ODBC<\/strong>\u00a0and select the\u00a0<strong>ODBC Data sources (32 bits)<\/strong>\n<div id=\"attachment_2780\" class=\"wp-caption aligncenter\">\n<div id=\"attachment_2780\" style=\"width: 395px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i1.wp.com\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/open-ODBC-Data-souce-administrator.png?ssl=1\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2780\" class=\"wp-image-2780 size-full\" src=\"https:\/\/i1.wp.com\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/open-ODBC-Data-souce-administrator.png?zoom=0.8999999761581421&amp;resize=385%2C520&amp;ssl=1\" alt=\"Open ODBC Data source\" width=\"385\" height=\"520\" \/><\/a><p id=\"caption-attachment-2780\" class=\"wp-caption-text\">Open ODBC Data Source<\/p><\/div>\n<\/div>\n<\/li>\n<li>As a second step, in ODBC Data source Administrator press the\u00a0<strong>Add<\/strong>\u00a0button.\n<div id=\"attachment_2725\" class=\"wp-caption aligncenter\">\n<div id=\"attachment_2725\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i1.wp.com\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/add-ZappySys.png?ssl=1\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2725\" class=\"wp-image-2725 size-full\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/add-ZappySys.png\" alt=\"Add ZappySys\" width=\"590\" height=\"423\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/add-ZappySys.png 590w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/add-ZappySys-300x215.png 300w\" sizes=\"(max-width: 590px) 100vw, 590px\" \/><\/a><p id=\"caption-attachment-2725\" class=\"wp-caption-text\">Add ZappySys<\/p><\/div>\n<\/div>\n<\/li>\n<li>In this step, create the new data source, select\u00a0<strong>ZappySys JSON Driver.<\/strong>\n<div id=\"attachment_2772\" class=\"wp-caption aligncenter\">\n<div id=\"attachment_2772\" style=\"width: 302px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i1.wp.com\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/create-new-data-source-zappysys-json-driver.png?ssl=1\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2772\" class=\"wp-image-2772 size-medium\" src=\"https:\/\/i1.wp.com\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/create-new-data-source-zappysys-json-driver.png?zoom=0.8999999761581421&amp;resize=292%2C218&amp;ssl=1\" alt=\"add new zappysys\" width=\"292\" height=\"217\" \/><\/a><p id=\"caption-attachment-2772\" class=\"wp-caption-text\">Add new zappysys json driver<\/p><\/div>\n<\/div>\n<\/li>\n<li>Here we have several properties, write a data source name. In this example, the name will be ZappySys JSON to Excel.<\/li>\n<li>The Data Source (URL or file path) can specify the URL of the source or if it is a local file, you can specify the local path. In this example, the URL is:\n<pre class=\"lang:default decode:true\">https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/Customers?$format=json<\/pre>\n<p>You can also specify a local file path as Data SourceFor a single file:\u00a0 c:\\data\\myfile_1.json<br \/>\nFor multiple files: c:\\data\\myfile_*.json<\/li>\n<li>Configure the ODBC JSON Driver like this and test the connection:\n<div id=\"attachment_7321\" style=\"width: 730px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/10\/odbc-JSON-driver-odata-configuration.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7321\" class=\"wp-image-7321 size-medium_large\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/10\/odbc-JSON-driver-odata-configuration-768x698.png\" alt=\"Configure JSON Driver for REST API Call\" width=\"720\" height=\"654\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/10\/odbc-JSON-driver-odata-configuration-768x698.png 768w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/10\/odbc-JSON-driver-odata-configuration-300x273.png 300w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/10\/odbc-JSON-driver-odata-configuration.png 849w\" sizes=\"(max-width: 720px) 100vw, 720px\" \/><\/a><p id=\"caption-attachment-7321\" class=\"wp-caption-text\">Configure JSON Driver for REST API Call<\/p><\/div><\/li>\n<li>Now click on Copy Connection string Button.\n<div id=\"attachment_7322\" style=\"width: 730px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-driver-copy-connection-string.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7322\" class=\"wp-image-7322 size-medium_large\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-driver-copy-connection-string-768x672.png\" alt=\"ODBC Driver : Copy Connection String\" width=\"720\" height=\"630\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-driver-copy-connection-string-768x672.png 768w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-driver-copy-connection-string-300x263.png 300w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-driver-copy-connection-string.png 802w\" sizes=\"(max-width: 720px) 100vw, 720px\" \/><\/a><p id=\"caption-attachment-7322\" class=\"wp-caption-text\">ODBC Driver : Copy Connection String<\/p><\/div><\/li>\n<li>That&#8217;s it Connection string is copied to clipboard. Now let&#8217;s use this connection string in the VBA code.<\/li>\n<\/ol>\n<h2><span id=\"How_to_import_REST_API_data_to_Excel\">How to import REST API data to Access using VBA<\/span><\/h2>\n<ol>\n<li>Open the access database and create the table with the desire columns to get API data in it.\n<div id=\"attachment_7324\" style=\"width: 730px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-create-table-in-access.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7324\" class=\"wp-image-7324 size-medium_large\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-create-table-in-access-768x511.png\" alt=\"Create Table in Access\" width=\"720\" height=\"479\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-create-table-in-access-768x511.png 768w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-create-table-in-access-300x200.png 300w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-create-table-in-access-1024x682.png 1024w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-create-table-in-access-272x182.png 272w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-create-table-in-access.png 1546w\" sizes=\"(max-width: 720px) 100vw, 720px\" \/><\/a><p id=\"caption-attachment-7324\" class=\"wp-caption-text\">Create Table in Access<\/p><\/div><\/li>\n<li>Now close the table, and go to Create menu and click on Form Design to add the new blank form in design view.\n<div id=\"attachment_7325\" style=\"width: 642px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-create-form-desing-access.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7325\" class=\"wp-image-7325 size-full\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-create-form-desing-access.png\" alt=\"Access : Create a New Form in Design View\" width=\"632\" height=\"402\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-create-form-desing-access.png 632w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-create-form-desing-access-300x191.png 300w\" sizes=\"(max-width: 632px) 100vw, 632px\" \/><\/a><p id=\"caption-attachment-7325\" class=\"wp-caption-text\">Access : Create a New Form in Design View<\/p><\/div><\/li>\n<li>It will open the new form in the design view, now add new button with the desire text.\n<div id=\"attachment_7326\" style=\"width: 730px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-add-access-command-button.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7326\" class=\"wp-image-7326 size-medium_large\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-add-access-command-button-768x459.png\" alt=\"Access : Add Command Button\" width=\"720\" height=\"430\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-add-access-command-button-768x459.png 768w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-add-access-command-button-300x179.png 300w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-add-access-command-button-1024x612.png 1024w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-add-access-command-button.png 1215w\" sizes=\"(max-width: 720px) 100vw, 720px\" \/><\/a><p id=\"caption-attachment-7326\" class=\"wp-caption-text\">Access : Add Command Button<\/p><\/div><\/li>\n<li>Now right click on button and go to properties and click on &#8230; builder button and select Code Builder.\n<div id=\"attachment_7327\" style=\"width: 730px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-select-code-builder-access.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7327\" class=\"wp-image-7327 size-medium_large\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-select-code-builder-access-768x529.png\" alt=\"Access : Code builder\" width=\"720\" height=\"496\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-select-code-builder-access-768x529.png 768w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-select-code-builder-access-300x207.png 300w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-select-code-builder-access.png 934w\" sizes=\"(max-width: 720px) 100vw, 720px\" \/><\/a><p id=\"caption-attachment-7327\" class=\"wp-caption-text\">Access : Code builder<\/p><\/div><\/li>\n<li>When you click the button, it will open a new VBA instance, executing the command event associated with that button click.<br \/>\nNext, insert the provided code inside the <i>Command5_Click()<\/i> function. In this example, the button is named Command5, and that&#8217;s why it&#8217;s added within this click function.<br \/>\nThe provided code encompasses the following steps:<\/p>\n<ol>\n<li><strong>Ensure the table is closed:<\/strong><br \/>\nIt&#8217;s crucial to close the table beforehand; otherwise, executing the subsequent command may result in an error.<\/li>\n<li><strong>Truncate the table:<br \/>\n<\/strong>Clear the existing data from the table. If you want to add fresh data each time<\/li>\n<li><strong>Make the API call:<br \/>\n<\/strong>Utilize the ODBC Driver connection string to initiate an API call.<\/li>\n<li><strong>Insert into the Access table:<br \/>\n<\/strong>Use the retrieved data from the API call to insert new records into the Access table.<\/li>\n<li><strong>Open the table:<br \/>\n<\/strong>Reopen the table to inspect the newly inserted data.<\/li>\n<\/ol>\n<pre class=\"lang:default decode:true\">    ' Pass your ZappySys Driver Connection String: Refer to below link to learn how to obtain the ZappySys Driver connection string:\r\n    ' https:\/\/community.zappysys.com\/t\/how-to-copy-the-zappysys-driver-connection-string\/172\r\n    Dim zsConnStr As String\r\n    zsConnStr = \"DRIVER={ZappySys JSON Driver};DataPath='https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/Customers?$format=json';Filter='$.value[*]';IncludeParentColumns=0;RequestMethod='GET';RequestHeaders='cache-control: no-cache || Accept: *\/*'\"\r\n        \r\n    'ZappySys Driver Query\r\n    Dim zsDriverQuery As String\r\n    zsDriverQuery = \"Select * from $\"\r\n \r\n    'MS Access Table Name\r\n    Dim tableName As String\r\n    tableName = \"tblCustomers\"\r\n\r\n    ' 1. Close Table If Open\r\n    CloseTableIfOpen tableName\r\n\r\n    ' 2. Truncate Table (Optional): If you want to load fresh data each time, uncomment the line below.\r\n    'TruncateTable tableName\r\n\r\n    ' 3. Import Data From API Into Table\r\n    ImportDataFromAPIIntoTable zsConnStr, zsDriverQuery, tableName\r\n\r\n    ' 4. Open Table for Viewing (Optional)\r\n    OpenTableForViewing tableName\r\n\r\n    ' Show Message after Loading Data Successfully\r\n    MsgBox \"Data Loaded Successfully!\"\r\n<\/pre>\n<div id=\"attachment_10917\" style=\"width: 744px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/ms-access-vba-button-onclick.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-10917\" class=\"size-full wp-image-10917\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/ms-access-vba-button-onclick.png\" alt=\"ms-access-vba-button-onclick\" width=\"734\" height=\"809\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/ms-access-vba-button-onclick.png 734w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/ms-access-vba-button-onclick-272x300.png 272w\" sizes=\"(max-width: 734px) 100vw, 734px\" \/><\/a><p id=\"caption-attachment-10917\" class=\"wp-caption-text\">VBA Button OnClick Function<\/p><\/div>\n<p>&nbsp;<\/li>\n<li>Below the <i>Private Sub Command5_Click()<\/i> function, please add the necessary functions and procedures as provided below:\n<pre class=\"lang:default decode:true \">Sub ImportDataFromAPIIntoTable(zsConnStr As String, zsDriverQuery As String, tableName As String)\r\n    Dim dscn As New ADODB.Connection\r\n    dscn.Open zsConnStr\r\n\r\n    Dim rs As Object\r\n    Set rs = New ADODB.Recordset\r\n    \r\n    ''ZappySys Driver Query Goes here\r\n    rs.Open zsDriverQuery, dscn\r\n\r\n    Dim strQuery As String\r\n    strQuery = \"\"\r\n    ' Check if the recordset is not empty\r\n    If Not rs.EOF Then\r\n        ' Get the field names\r\n        Dim fieldNames As String\r\n        fieldNames = \"\"\r\n\r\n        For i = 1 To rs.Fields.Count\r\n            fieldNames = fieldNames &amp; rs.Fields(i - 1).Name\r\n            If i &lt; rs.Fields.Count Then\r\n                fieldNames = fieldNames &amp; \",\"\r\n            End If\r\n        Next i\r\n\r\n        ' Generate the INSERT script\r\n        Dim insertScript As String\r\n        ' Iterate through the recordset to get the values\r\n        Do Until rs.EOF\r\n            ' Generate Insert script\r\n            insertScript = \"INSERT INTO \" &amp; tableName &amp; \" (\" &amp; fieldNames &amp; \") VALUES\"\r\n            insertScript = insertScript &amp; vbCrLf &amp; \"(\"\r\n            For i = 1 To rs.Fields.Count\r\n                ' Assuming all fields are text, you might need to handle different data types appropriately\r\n                \r\n                If IsNull(rs.Fields(i - 1).Value) Then\r\n                    insertScript = insertScript &amp; \"''\"\r\n                Else\r\n                    insertScript = insertScript &amp; \"'\" &amp; EscapeSingleQuote(rs.Fields(i - 1).Value) &amp; \"'\"\r\n                End If\r\n                \r\n                \r\n                If i &lt; rs.Fields.Count Then\r\n                    insertScript = insertScript &amp; \",\"\r\n                End If\r\n            Next i\r\n            insertScript = insertScript &amp; \")\"\r\n            \r\n            'Insert data\r\n            CurrentProject.Connection.Execute insertScript\r\n            \r\n            rs.MoveNext\r\n        Loop\r\n    End If\r\n    \r\n    ' Close the recordset and connection\r\n    rs.Close\r\n    dscn.Close\r\n    Set rs = Nothing\r\n    Set conn = Nothing\r\n    \r\nEnd Sub\r\n\r\nSub OpenTableForViewing(tableName As String)\r\n    If Not IsTableOpen(tableName) Then\r\n        DoCmd.OpenTable tableName\r\n    End If\r\nEnd Sub\r\n\r\nPublic Function IsTableOpen(strName As String) As Boolean\r\n     IsTableOpen = SysCmd(acSysCmdGetObjectState, acTable, strName)\r\nEnd Function\r\n\r\nSub CloseTableIfOpen(tableName As String)\r\n    If IsTableOpen(tableName) Then\r\n        DoCmd.SelectObject acTable, tableName\r\n        DoCmd.RunCommand acCmdSaveRecord\r\n        DoCmd.Close\r\n    End If\r\nEnd Sub\r\n\r\n\r\nSub TruncateTable(tableName As String)\r\n    Dim strSql As String\r\n    strSql = \"DELETE FROM \" &amp; tableName &amp; \";\"\r\n    CurrentProject.Connection.Execute strSql\r\nEnd Sub\r\n\r\nPublic Function EscapeSingleQuote(strData As String) As String\r\n     EscapeSingleQuote = Replace(strData, \"'\", \"''\")\r\nEnd Function\r\n<\/pre>\n<\/li>\n<li>Now, save the VBA form code and provide some appropriate form names.\n<div id=\"attachment_7332\" style=\"width: 730px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-vba-save-form.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7332\" class=\"size-medium_large wp-image-7332\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-vba-save-form-768x943.png\" alt=\"Save form vba code\" width=\"720\" height=\"884\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-vba-save-form-768x943.png 768w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-vba-save-form-244x300.png 244w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-vba-save-form-834x1024.png 834w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-vba-save-form.png 849w\" sizes=\"(max-width: 720px) 100vw, 720px\" \/><\/a><p id=\"caption-attachment-7332\" class=\"wp-caption-text\">Save form vba code<\/p><\/div>\n<p>&nbsp;<\/li>\n<li>Make sure to add the reference to the Microsoft ActiveX Data Objects X.0 Library in the project settings.In Microsoft Access VBA,<br \/>\nYou can add the reference to the Microsoft ActiveX Data Objects X.0 Library by following these steps:<\/p>\n<ol>\n<li>In the VBA editor, go to &#8220;Tools&#8221; in the menu and select &#8220;References.&#8221;<\/li>\n<li>In the References dialog box, scroll down the list to find &#8220;Microsoft ActiveX Data Objects X.0 Library&#8221; (where &#8220;X.0&#8221; corresponds to the version number, such as 6.1, 2.8, etc.).<\/li>\n<li>Check the box next to the appropriate version to enable the reference.<\/li>\n<li>Click &#8220;OK&#8221; to save the changes and close the References dialog box.<\/li>\n<\/ol>\n<p>Now, your Access project has a reference to the Microsoft ActiveX Data Objects library, and you can use its features in your VBA code.<\/p>\n<div id=\"attachment_7336\" style=\"width: 730px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-access-add-reference.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7336\" class=\"size-medium_large wp-image-7336\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-access-add-reference-768x648.png\" alt=\"Access : Add reference\" width=\"720\" height=\"608\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-access-add-reference-768x648.png 768w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-access-add-reference-300x253.png 300w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-access-add-reference.png 804w\" sizes=\"(max-width: 720px) 100vw, 720px\" \/><\/a><p id=\"caption-attachment-7336\" class=\"wp-caption-text\">Access : Add reference<\/p><\/div>\n<p>If the MS ActiveX reference is not added, an error will be thrown.<\/p>\n<div id=\"attachment_7335\" style=\"width: 721px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-vba-error-type-not-found.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7335\" class=\"wp-image-7335 size-full\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-vba-error-type-not-found-e1705479944324.png\" alt=\"VBA : Error Type not defined\" width=\"711\" height=\"797\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-vba-error-type-not-found-e1705479944324.png 711w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-vba-error-type-not-found-e1705479944324-268x300.png 268w\" sizes=\"(max-width: 711px) 100vw, 711px\" \/><\/a><p id=\"caption-attachment-7335\" class=\"wp-caption-text\">VBA : Error Type not defined<\/p><\/div><\/li>\n<li>Close the code project, open the form in Form View, and click on the button.\n<div id=\"attachment_7333\" style=\"width: 730px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-access-click-button.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7333\" class=\"size-medium_large wp-image-7333\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-access-click-button-768x705.png\" alt=\"Access : Click Command Button\" width=\"720\" height=\"661\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-access-click-button-768x705.png 768w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-access-click-button-300x275.png 300w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-access-click-button.png 939w\" sizes=\"(max-width: 720px) 100vw, 720px\" \/><\/a><p id=\"caption-attachment-7333\" class=\"wp-caption-text\">Access : Click Command Button<\/p><\/div><\/li>\n<li>After clicking the button, it will initiate a REST API call, insert the data into the Access table, and open the table to display the inserted records along with a success message.\n<div id=\"attachment_7334\" style=\"width: 730px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-access-code-success-message.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7334\" class=\"size-medium_large wp-image-7334\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-access-code-success-message-768x705.png\" alt=\"Access : Open the table\" width=\"720\" height=\"661\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-access-code-success-message-768x705.png 768w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-access-code-success-message-300x275.png 300w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/odbc-access-code-success-message.png 939w\" sizes=\"(max-width: 720px) 100vw, 720px\" \/><\/a><p id=\"caption-attachment-7334\" class=\"wp-caption-text\">Access : Open the table<\/p><\/div><\/li>\n<\/ol>\n<div class=\"content_block\" id=\"custom_post_widget-8935\"><h2>Troubleshooting Errors<\/h2>\r\n<p>While running in Access\\Excel\\other and reading data from DSN created with ODBC PowerPack, if you get this error \"<strong>License type [ODBC_PP_TRIAL] not found or its expired<\/strong>\"<\/p>\r\n\r\n<p>Please refer to this article for the same:\u00a0\u00a0<a href=\"https:\/\/zappysys.zendesk.com\/hc\/en-us\/articles\/360042521533-Troubleshooting-License-type-ODBC-PP-TRIAL-not-found-or-its-expired-error-in-Microsoft-Access\" target=\"_blank\" rel=\"noopener\">Troubleshooting \"License type [ODBC_PP_TRIAL] not found or its expired\" error in Microsoft Access<\/a><\/p><\/div>\n<h2><span id=\"Conclusion\">Conclusion<\/span><\/h2>\n<p>In this article, we saw how to use VBA to call REST API. We show how to do REST API calls in Access using the ZappySys ODBC driver. Also, we show how to write VBA Code in MS Access for command button to make REST API call, truncate access table and insert record in the access table using VBA code. If you liked this\u00a0article and you want to try, you can download the\u00a0<a href=\"https:\/\/zappysys.com\/products\/odbc-powerpack\/download\/\" target=\"_blank\" rel=\"noopener\">ZappySys ODBC\u00a0installer here<\/a>.<\/p>\n<h2><span id=\"References\">References<\/span><\/h2>\n<ul>\n<li><a href=\"https:\/\/zappysys.com\/products\/odbc-powerpack\/download\/\" target=\"_blank\" rel=\"noopener\">ZappySys\u00a0ODBC installer.<\/a><\/li>\n<li><a href=\"https:\/\/stackoverflow.com\/questions\/49984642\/access-odbc-query\" target=\"_blank\" rel=\"noopener\">Access ODBC Query<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/ado\/guide\/appendixes\/using-ado-with-microsoft-visual-basic?view=sql-server-2017\" target=\"_blank\" rel=\"noopener\">Using ADO with Microsoft Visual Basic and Visual Basic for Applications<\/a><\/li>\n<\/ul>\n<h2>\nForm VBA Code:<\/h2>\n<p>After completing the migration of the higher-level VBA code, you&#8217;ll notice a transformation in the structure of your forms&#8217; code.<\/p>\n<pre class=\"lang:default decode:true  \">Option Compare Database\r\n\r\nPrivate Sub Command5_Click()\r\n \r\n    ' Pass your ZappySys Driver Connection String: Refer to below link to learn how to obtain the ZappySys Driver connection string:\r\n    ' https:\/\/community.zappysys.com\/t\/how-to-copy-the-zappysys-driver-connection-string\/172\r\n    Dim zsConnStr As String\r\n    zsConnStr = \"DRIVER={ZappySys JSON Driver};DataPath='https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/Customers?$format=json';Filter='$.value[*]';IncludeParentColumns=0;RequestMethod='GET';RequestHeaders='cache-control: no-cache || Accept: *\/*'\"\r\n        \r\n    'ZappySys Driver Query\r\n    Dim zsDriverQuery As String\r\n    zsDriverQuery = \"Select * from $\"\r\n \r\n    'MS Access Table Name\r\n    Dim tableName As String\r\n    tableName = \"tblCustomers\"\r\n\r\n    ' 1. Close Table If Open\r\n    CloseTableIfOpen tableName\r\n\r\n    ' 2. Truncate Table (Optional): If you want to load fresh data each time, uncomment the line below.\r\n    'TruncateTable tableName\r\n\r\n    ' 3. Import Data From API Into Table\r\n    ImportDataFromAPIIntoTable zsConnStr, zsDriverQuery, tableName\r\n\r\n    ' 4. Open Table for Viewing (Optional)\r\n    OpenTableForViewing tableName\r\n\r\n    ' Show Message after Loading Data Successfully\r\n    MsgBox \"Data Loaded Successfully!\"\r\n    \r\nEnd Sub\r\n\r\nSub ImportDataFromAPIIntoTable(zsConnStr As String, zsDriverQuery As String, tableName As String)\r\n    Dim dscn As New ADODB.Connection\r\n    dscn.Open zsConnStr\r\n\r\n    Dim rs As Object\r\n    Set rs = New ADODB.Recordset\r\n    \r\n    ''ZappySys Driver Query Goes here\r\n    rs.Open zsDriverQuery, dscn\r\n\r\n    Dim strQuery As String\r\n    strQuery = \"\"\r\n    ' Check if the recordset is not empty\r\n    If Not rs.EOF Then\r\n        ' Get the field names\r\n        Dim fieldNames As String\r\n        fieldNames = \"\"\r\n\r\n        For i = 1 To rs.Fields.Count\r\n            fieldNames = fieldNames &amp; rs.Fields(i - 1).Name\r\n            If i &lt; rs.Fields.Count Then\r\n                fieldNames = fieldNames &amp; \",\"\r\n            End If\r\n        Next i\r\n\r\n        ' Generate the INSERT script\r\n        Dim insertScript As String\r\n        ' Iterate through the recordset to get the values\r\n        Do Until rs.EOF\r\n            ' Generate Insert script\r\n            insertScript = \"INSERT INTO \" &amp; tableName &amp; \" (\" &amp; fieldNames &amp; \") VALUES\"\r\n            insertScript = insertScript &amp; vbCrLf &amp; \"(\"\r\n            For i = 1 To rs.Fields.Count\r\n                ' Assuming all fields are text, you might need to handle different data types appropriately\r\n                \r\n                If IsNull(rs.Fields(i - 1).Value) Then\r\n                    insertScript = insertScript &amp; \"''\"\r\n                Else\r\n                    insertScript = insertScript &amp; \"'\" &amp; EscapeSingleQuote(rs.Fields(i - 1).Value) &amp; \"'\"\r\n                End If\r\n                \r\n                \r\n                If i &lt; rs.Fields.Count Then\r\n                    insertScript = insertScript &amp; \",\"\r\n                End If\r\n            Next i\r\n            insertScript = insertScript &amp; \")\"\r\n            \r\n            'Insert data\r\n            CurrentProject.Connection.Execute insertScript\r\n            \r\n            rs.MoveNext\r\n        Loop\r\n    End If\r\n    \r\n    ' Close the recordset and connection\r\n    rs.Close\r\n    dscn.Close\r\n    Set rs = Nothing\r\n    Set conn = Nothing\r\n    \r\nEnd Sub\r\n\r\nSub OpenTableForViewing(tableName As String)\r\n    If Not IsTableOpen(tableName) Then\r\n        DoCmd.OpenTable tableName\r\n    End If\r\nEnd Sub\r\n\r\nPublic Function IsTableOpen(strName As String) As Boolean\r\n     IsTableOpen = SysCmd(acSysCmdGetObjectState, acTable, strName)\r\nEnd Function\r\n\r\nSub CloseTableIfOpen(tableName As String)\r\n    If IsTableOpen(tableName) Then\r\n        DoCmd.SelectObject acTable, tableName\r\n        DoCmd.RunCommand acCmdSaveRecord\r\n        DoCmd.Close\r\n    End If\r\nEnd Sub\r\n\r\n\r\nSub TruncateTable(tableName As String)\r\n    Dim strSql As String\r\n    strSql = \"DELETE FROM \" &amp; tableName &amp; \";\"\r\n    CurrentProject.Connection.Execute strSql\r\nEnd Sub\r\n\r\nPublic Function EscapeSingleQuote(strData As String) As String\r\n     EscapeSingleQuote = Replace(strData, \"'\", \"''\")\r\nEnd Function\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h2><\/h2>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In our previous blog we saw how to export REST API to CSV using c# or Python. In this post we will look at specific example on How to Export REST API to MS Access using VBA Command Button, along with few other topics such as how to make REST API Call, how to [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":7318,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[277,394,176],"tags":[512,6,279,511],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\r\n<title>How to Export REST API to MS Access using VBA Command Button | ZappySys Blog<\/title>\r\n<meta name=\"description\" content=\"How to Export REST API to MS Access using VBA Command Button, How to Make ODBC Driver Call in MS Access using VBA Command Button\" \/>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"How to Export REST API to MS Access using VBA Command Button | ZappySys Blog\" \/>\r\n<meta property=\"og:description\" content=\"How to Export REST API to MS Access using VBA Command Button, How to Make ODBC Driver Call in MS Access using VBA Command Button\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/\" \/>\r\n<meta property=\"og:site_name\" content=\"ZappySys Blog\" \/>\r\n<meta property=\"article:published_time\" content=\"2019-06-29T09:34:55+00:00\" \/>\r\n<meta property=\"article:modified_time\" content=\"2024-01-17T11:26:44+00:00\" \/>\r\n<meta property=\"og:image\" content=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/VBA_250x250.png\" \/>\r\n\t<meta property=\"og:image:width\" content=\"250\" \/>\r\n\t<meta property=\"og:image:height\" content=\"250\" \/>\r\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\r\n<meta name=\"author\" content=\"ZappySys\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ZappySys\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/\",\"url\":\"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/\",\"name\":\"How to Export REST API to MS Access using VBA Command Button | ZappySys Blog\",\"isPartOf\":{\"@id\":\"https:\/\/zappysys.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/VBA_250x250.png\",\"datePublished\":\"2019-06-29T09:34:55+00:00\",\"dateModified\":\"2024-01-17T11:26:44+00:00\",\"author\":{\"@id\":\"https:\/\/zappysys.com\/blog\/#\/schema\/person\/c9dc782c929d0027e2e87e3951ce9d35\"},\"description\":\"How to Export REST API to MS Access using VBA Command Button, How to Make ODBC Driver Call in MS Access using VBA Command Button\",\"breadcrumb\":{\"@id\":\"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/#primaryimage\",\"url\":\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/VBA_250x250.png\",\"contentUrl\":\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/VBA_250x250.png\",\"width\":250,\"height\":250,\"caption\":\"VBA\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/zappysys.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Export REST API to MS Access using VBA Command Button\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/zappysys.com\/blog\/#website\",\"url\":\"https:\/\/zappysys.com\/blog\/\",\"name\":\"ZappySys Blog\",\"description\":\"SSIS \/ ODBC Drivers \/ API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/zappysys.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/zappysys.com\/blog\/#\/schema\/person\/c9dc782c929d0027e2e87e3951ce9d35\",\"name\":\"ZappySys\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zappysys.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/076a738938c19d459fbfe125c759a0ea?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/076a738938c19d459fbfe125c759a0ea?s=96&d=mm&r=g\",\"caption\":\"ZappySys\"},\"url\":\"https:\/\/zappysys.com\/blog\/author\/hshah\/\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Export REST API to MS Access using VBA Command Button | ZappySys Blog","description":"How to Export REST API to MS Access using VBA Command Button, How to Make ODBC Driver Call in MS Access using VBA Command Button","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/","og_locale":"en_US","og_type":"article","og_title":"How to Export REST API to MS Access using VBA Command Button | ZappySys Blog","og_description":"How to Export REST API to MS Access using VBA Command Button, How to Make ODBC Driver Call in MS Access using VBA Command Button","og_url":"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/","og_site_name":"ZappySys Blog","article_published_time":"2019-06-29T09:34:55+00:00","article_modified_time":"2024-01-17T11:26:44+00:00","og_image":[{"width":250,"height":250,"url":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/VBA_250x250.png","type":"image\/png"}],"author":"ZappySys","twitter_card":"summary_large_image","twitter_misc":{"Written by":"ZappySys","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/","url":"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/","name":"How to Export REST API to MS Access using VBA Command Button | ZappySys Blog","isPartOf":{"@id":"https:\/\/zappysys.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/#primaryimage"},"image":{"@id":"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/#primaryimage"},"thumbnailUrl":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/VBA_250x250.png","datePublished":"2019-06-29T09:34:55+00:00","dateModified":"2024-01-17T11:26:44+00:00","author":{"@id":"https:\/\/zappysys.com\/blog\/#\/schema\/person\/c9dc782c929d0027e2e87e3951ce9d35"},"description":"How to Export REST API to MS Access using VBA Command Button, How to Make ODBC Driver Call in MS Access using VBA Command Button","breadcrumb":{"@id":"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/#primaryimage","url":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/VBA_250x250.png","contentUrl":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2019\/06\/VBA_250x250.png","width":250,"height":250,"caption":"VBA"},{"@type":"BreadcrumbList","@id":"https:\/\/zappysys.com\/blog\/export-rest-api-ms-access-using-vba-command-button\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zappysys.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Export REST API to MS Access using VBA Command Button"}]},{"@type":"WebSite","@id":"https:\/\/zappysys.com\/blog\/#website","url":"https:\/\/zappysys.com\/blog\/","name":"ZappySys Blog","description":"SSIS \/ ODBC Drivers \/ API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zappysys.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/zappysys.com\/blog\/#\/schema\/person\/c9dc782c929d0027e2e87e3951ce9d35","name":"ZappySys","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zappysys.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/076a738938c19d459fbfe125c759a0ea?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/076a738938c19d459fbfe125c759a0ea?s=96&d=mm&r=g","caption":"ZappySys"},"url":"https:\/\/zappysys.com\/blog\/author\/hshah\/"}]}},"_links":{"self":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts\/7317"}],"collection":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/comments?post=7317"}],"version-history":[{"count":18,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts\/7317\/revisions"}],"predecessor-version":[{"id":10920,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts\/7317\/revisions\/10920"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/media\/7318"}],"wp:attachment":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/media?parent=7317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/categories?post=7317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/tags?post=7317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}