Getting UPC Data from the Web and Parsing it Into a Table

1 year ago
11

This video tell how to retrieve UPC information from a public database on the web and parse it into fields in your MS Access database. A series of queries finishes the job and puts the data into a table.

The code I used:
Public Sub ReadJSON(UPC As String)
Dim reader As New XMLHTTP60
Dim URL As String
Dim db As DAO.Database
Dim rs As DAO.Recordset

URL = "https://api.upcitemdb.com/prod/trial/lookup?upc=" & UPC
reader.Open "get", URL, False
reader.send

Do Until reader.ReadyState = 4
DoEvents
Loop

If reader.status = 200 Then
Set db = CurrentDb
Set rs = db.OpenRecordset("json", dbOpenDynaset, dbSeeChanges)
rs.AddNew
rs!inputtext = reader.responseText
rs.Update
DoEvents
Else
Dim errorcode As Integer
errorcode = reader.status
MsgBox "Connection not made. Error code " & errorcode
End If
End Sub

See my other channels:
Current news on the economy and economic concepts: https://www.youtube.com/channel/UCl0IMB6BJMSNuNN5rPd6jxw
Current thoughts on leadership topics: https://www.youtube.com/channel/UCDsp8v1TezEiXIdgVijDK7w
Blockchain and Cryptocurrency News:
https://www.youtube.com/channel/UCP3uIfVMCTSNfpvwHf6EEow

Loading comments...