NauticalGent
Ignore List Poster Boy
- Local time
- Today, 09:40
- Joined
- Apr 27, 2015
- Messages
- 6,596
Good morning everyone,
Using the code in this video, I thought "wow, looks pretty easy, let me give a try with something I have been wanting to do!"
Here is my modified code:
Using the code in this video, I thought "wow, looks pretty easy, let me give a try with something I have been wanting to do!"
Here is my modified code:
It works great but I am not getting the actual results. I am sure that it is because if you use the site interactively, you have to accept cookies and click some "A agree" buttons but and am not sure and if I AM right, is there a way around this?Code:Public Sub ReadJSON(strCAGE As String) ' the CAGE I am passing is "00060" Dim Reader As New xmlhttp60 'Refrence to Microsoft XML, V6.0 required Dim strURL As String Dim db As DAO.Database Dim rs As DAO.Recordset strURL = https://cage.dla.mil/Search/Results?q= & strCAGE & "&page=1" '00060 Reader.Open "get", strURL, False Reader.send Do Until Reader.ReadyState = 4 DoEvents Loop If Reader.status = 200 Then Set db = CurrentDb Set rs = db.OpenRecordset("tblCAGE", dbOpenDynaset, dbSeeChanges) With rs .AddNew rs!CAGE = strCAGE rs!Description = Reader.responseText .Update DoEvents End With Else Dim intError As Integer intError = Reader.status MsgBox "Connection not made. Error Code: " & intError End If End Sub