将JSON数据解析为Access表而不使用json arraey标签

时间:2017-09-28 14:39:26

标签: json vba ms-access

我已经做了一些搜索而且没有到达任何地方,我对JSON数据知之甚少,不知道它是文件格式问题还是我做错了。

我想了解这个JSON提要的详细信息(这是一个示例,真实数据可能是数百次迭代)并将元素解析为访问表

[
    {
        "href": "https://bp105.betapark.co.uk/api/v1/orders/1",
        "help": "https://bp105.betapark.co.uk/api/v1/help/orders",
        "id": 1,
        "order_number": "IN1001",
        "channel": {
            "id": 0,
            "name": "",
            "order_id": 0,
            "order_number": ""
        },
        "invoice_number": "",
        "order_date": "2017-09-28T14:20:55+01:00",
        "invoice_date": "2017-09-28",
        "due_date": "2017-09-28",
        "delivery_date": "",
        "despatch_date": "",
        "status": {
            "id": 1,
            "name": "Pending"
        },
        "custom_status": {
            "id": 0,
            "name": ""
        },
        "paid": true,
        "paid_on": "2017-09-28T14:20:55+01:00",
        "placed_by": "admin",
        "completed_on": "",
        "completed_by": "",
        "user_id": "0",
        "email_address": "christopher.nash@xxxx.co.uk",
        "allow_contact": true,
        "user_group": {
            "id": 0,
            "name": ""
        },
        "account_id": null,
        "billing_address": {
            "title": "Mr",
            "title_id": 1,
            "first_name": "Chris",
            "last_name": "Nash",
            "company_name": "",
            "address_line_1": "23  Road",
            "address_line_2": "",
            "town_city": "Bradford",
            "county": "",
            "postcode": "BD66 2QH",
            "country": "United Kingdom",
            "country_code": "GB",
            "telephone_number": "01274 885521",
            "vat_number": "",
            "facebook_id": "",
            "reference": ""
        },
        "delivery_address": {
            "title": "Mr",
            "title_id": 1,
            "first_name": "Chris",
            "last_name": "Nash",
            "company_name": "",
            "address_line_1": "23  Road",
            "address_line_2": "",
            "town_city": "Bradford",
            "county": "",
            "postcode": "BD66 2QH",
            "country": "United Kingdom",
            "country_code": "GB",
            "telephone_number": "01274 885521",
            "billing_match": true
        },
        "currency_code": "GBP",
        "vat_rate": "20.00",
        "vat_base": "inc",
        "payment_method": {
            "value": "card",
            "description": "Credit / Debit Card",
            "card_type": "",
            "card_digits": false
        },
        "payment_checks": {
            "failures": "0",
            "avs_address": "",
            "avs_postcode": "",
            "cv2": "",
            "3ds": ""
        },
        "payment_id": null,
        "payment_total": "0.00",
        "payment_type": "",
        "payment_taken": "0.00",
        "voucher_code": "",
        "voucher_total": "0.00",
        "points_used": "0",
        "points_total": "0.00",
        "products": [
            {
                "href": "https://bp105.betapark.co.uk/api/v1/orders/1/products/1",
                "help": "https://bp105.betapark.co.uk/api/v1/help/orders/products",
                "id": 1,
                "sku": "TEST3",
                "variant_id": "",
                "product_sku": "TEST3",
                "product_id": 46,
                "bar_code": "",
                "part_number": "",
                "title": "Template Product Three",
                "variant_title": "",
                "category": {
                    "id": 8,
                    "title_path": "Skin Care|Watches",
                    "title": "Watches"
                },
                "brand": {
                    "id": 0,
                    "name": ""
                },
                "supplier": {
                    "id": 0,
                    "name": "",
                    "drop_shipper": false
                },
                "intangible": false,
                "product_file": {
                    "value": "",
                    "url": "",
                    "downloaded": 0
                },
                "file_group": {
                    "id": 0,
                    "name": ""
                },
                "bundle": false,
                "bundled": {
                    "parent_id": "0",
                    "parent_sku": ""
                },
                "gift_voucher": false,
                "weight": "0.000",
                "quantity": 1,
                "quantity_picked": "0",
                "quantity_shipped": "0",
                "quantity_refunded": "0",
                "warehouse_location": "",
                "frequency": "",
                "instalments": "0",
                "vat_rate": "20.00",
                "price_cost_exc_vat": "0.00",
                "price_cost_inc_vat": "0.00",
                "price_cost_vat": "0.00",
                "price_full_exc_vat": "0.00",
                "price_full_inc_vat": "0.00",
                "price_full_vat": "0.00",
                "price_paid_exc_vat": "0.00",
                "price_paid_inc_vat": "0.00",
                "price_paid_vat": "0.00",
                "subtotal_exc_vat": "0.00",
                "subtotal_inc_vat": "0.00",
                "subtotal_vat": "0.00",
                "addition_lines": []
            }
        ],
        "subtotal_exc_vat": "0.00",
        "subtotal_inc_vat": "0.00",
        "subtotal_vat": "0.00",
        "discount_total_exc_vat": "0.00",
        "discount_total_inc_vat": "0.00",
        "coupon_code": "",
        "coupon_total_exc_vat": "0.00",
        "coupon_total_inc_vat": "0.00",
        "weight_total": "0.000",
        "shipping_method": {
            "id": 1,
            "name": "UK Standard",
            "reference": "",
            "tracking_url": ""
        },
        "shipping_vat_rate": "20.00",
        "shipping_total_exc_vat": "0.00",
        "shipping_total_inc_vat": "0.00",
        "shipping_total_vat": "0.00",
        "total_exc_vat": "0.00",
        "total_inc_vat": "0.00",
        "total_vat": "0.00",
        "refunded_total": "0.00",
        "points_earned": "0",
        "ip_address": "88.211.116.162",
        "device_type": "desktop",
        "site_version": "desktop",
        "affiliate": {
            "id": 0,
            "name": ""
        },
        "referring_domain": "",
        "referring_search": "",
        "customer_comments": "",
        "admin_comments": "",
        "admin_comments_public": false,
        "modified": "2017-09-28T14:20:55+01:00"
    },
    {
        "href": "https://bp105.betapark.co.uk/api/v1/orders/2",
        "help": "https://bp105.betapark.co.uk/api/v1/help/orders",
        "id": 2,
        "order_number": "IN1002",
        "channel": {
            "id": 0,
            "name": "",
            "order_id": 0,
            "order_number": ""
        },
        "invoice_number": "",
        "order_date": "2017-09-28T14:58:43+01:00",
        "invoice_date": "2017-09-28",
        "due_date": "2017-09-28",
        "delivery_date": "",
        "despatch_date": "",
        "status": {
            "id": 1,
            "name": "Pending"
        },
        "custom_status": {
            "id": 0,
            "name": ""
        },
        "paid": true,
        "paid_on": "2017-09-28T14:58:43+01:00",
        "placed_by": "admin",
        "completed_on": "",
        "completed_by": "",
        "user_id": "0",
        "email_address": "christopher.nash@xxxx.co.uk",
        "allow_contact": true,
        "user_group": {
            "id": 0,
            "name": ""
        },
        "account_id": null,
        "billing_address": {
            "title": "Mr",
            "title_id": 1,
            "first_name": "Christopher",
            "last_name": "Nash",
            "company_name": "",
            "address_line_1": "xxxx",
            "address_line_2": "",
            "town_city": "Bradford",
            "county": "",
            "postcode": "BD66 2QH",
            "country": "United Kingdom",
            "country_code": "GB",
            "telephone_number": "07522",
            "vat_number": "",
            "facebook_id": "",
            "reference": ""
        },
        "delivery_address": {
            "title": "Mr",
            "title_id": 1,
            "first_name": "Christopher",
            "last_name": "Nash",
            "company_name": "",
            "address_line_1": "xxxx",
            "address_line_2": "",
            "town_city": "Bradford",
            "county": "",
            "postcode": "BD66 2QH",
            "country": "United Kingdom",
            "country_code": "GB",
            "telephone_number": "07522",
            "billing_match": true
        },
        "currency_code": "GBP",
        "vat_rate": "20.00",
        "vat_base": "inc",
        "payment_method": {
            "value": "card",
            "description": "Credit / Debit Card",
            "card_type": "",
            "card_digits": false
        },
        "payment_checks": {
            "failures": "0",
            "avs_address": "",
            "avs_postcode": "",
            "cv2": "",
            "3ds": ""
        },
        "payment_id": null,
        "payment_total": "0.00",
        "payment_type": "",
        "payment_taken": "0.00",
        "voucher_code": "",
        "voucher_total": "0.00",
        "points_used": "0",
        "points_total": "0.00",
        "products": [
            {
                "href": "https://bp105.betapark.co.uk/api/v1/orders/2/products/2",
                "help": "https://bp105.betapark.co.uk/api/v1/help/orders/products",
                "id": 2,
                "sku": "TEST3",
                "variant_id": "",
                "product_sku": "TEST3",
                "product_id": 46,
                "bar_code": "",
                "part_number": "",
                "title": "Template Product Three",
                "variant_title": "",
                "category": {
                    "id": 8,
                    "title_path": "Skin Care|Watches",
                    "title": "Watches"
                },
                "brand": {
                    "id": 0,
                    "name": ""
                },
                "supplier": {
                    "id": 0,
                    "name": "",
                    "drop_shipper": false
                },
                "intangible": false,
                "product_file": {
                    "value": "",
                    "url": "",
                    "downloaded": 0
                },
                "file_group": {
                    "id": 0,
                    "name": ""
                },
                "bundle": false,
                "bundled": {
                    "parent_id": "0",
                    "parent_sku": ""
                },
                "gift_voucher": false,
                "weight": "0.000",
                "quantity": 1,
                "quantity_picked": "0",
                "quantity_shipped": "0",
                "quantity_refunded": "0",
                "warehouse_location": "",
                "frequency": "",
                "instalments": "0",
                "vat_rate": "20.00",
                "price_cost_exc_vat": "0.00",
                "price_cost_inc_vat": "0.00",
                "price_cost_vat": "0.00",
                "price_full_exc_vat": "0.00",
                "price_full_inc_vat": "0.00",
                "price_full_vat": "0.00",
                "price_paid_exc_vat": "0.00",
                "price_paid_inc_vat": "0.00",
                "price_paid_vat": "0.00",
                "subtotal_exc_vat": "0.00",
                "subtotal_inc_vat": "0.00",
                "subtotal_vat": "0.00",
                "addition_lines": []
            }
        ],
        "subtotal_exc_vat": "0.00",
        "subtotal_inc_vat": "0.00",
        "subtotal_vat": "0.00",
        "discount_total_exc_vat": "0.00",
        "discount_total_inc_vat": "0.00",
        "coupon_code": "",
        "coupon_total_exc_vat": "0.00",
        "coupon_total_inc_vat": "0.00",
        "weight_total": "0.000",
        "shipping_method": {
            "id": 1,
            "name": "UK Standard",
            "reference": "",
            "tracking_url": ""
        },
        "shipping_vat_rate": "20.00",
        "shipping_total_exc_vat": "0.00",
        "shipping_total_inc_vat": "0.00",
        "shipping_total_vat": "0.00",
        "total_exc_vat": "0.00",
        "total_inc_vat": "0.00",
        "total_vat": "0.00",
        "refunded_total": "0.00",
        "points_earned": "0",
        "ip_address": "88.211.116.162",
        "device_type": "desktop",
        "site_version": "desktop",
        "affiliate": {
            "id": 0,
            "name": ""
        },
        "referring_domain": "",
        "referring_search": "",
        "customer_comments": "",
        "admin_comments": "",
        "admin_comments_public": false,
        "modified": "2017-09-28T14:58:43+01:00"
    }
]

我想提取多个信息,例如ID,帐单地址元素,递送地址元素,产品信息和其他一些信息。

我发现的所有示例似乎都要求每个订单迭代都标记为Access VBA to parse json,但我无法使其正常工作。

每个退回的订单及其信息都没有我可以为每个人说的标签...在json do .....

任何帮助都会很棒

先谢谢 - 克里斯

0 个答案:

没有答案