Just came across your Git and tried to create a short JSON file with it from a database query.
But when I try to run it I get the following error:
<p>Microsoft VBScript runtime </font> <font face="Arial" size=2>error '800a01ca'</font>
<p>
<font face="Arial" size=2>Variable uses an Automation type not supported in VBScript: 'TypeName'</font>
<p>
<font face="Arial" size=2>/includes/aspJSON1.18.asp</font><font face="Arial" size=2>, line 175</font>
The script that I'm using is the following:
response.ContentType = "application/json"
Dim GetArray, vJSON
Set ConnObj=Server.CreateObject("ADODB.Connection")
ConnObj.Open myDSN
set rs = ConnObj.execute(strSQLA)
If rs.BOF or rs.EOF Then
Else
GetArray = rs.GetRows()
End If
rs.Close
ConnObj.Close
Set rs = Nothing
Set ConnObj = Nothing
'Write JSON
Set vJSON = New aspJSON
With vJSON.data
For i = 0 to UBound(GetArray,2)
.Add i, vJSON.Collection()
With .item(i)
.Add "Date", GetArray(0,i)
.Add "Temperature", GetArray(1,i)
.Add "Humidity", GetArray(2,i)
End With
Next
End With
Response.Write vJSON.JSONoutput()
And there is no "strange" data in the Query. This is the result I get from the database:
Hi, sometimes SQL server database types don't match VB types.
As a workaround you could change these lines:
.Add "Temperature", cdbl(GetArray(1,i))
.Add "Humidity", cdbl(GetArray(2,i))
Just came across your Git and tried to create a short JSON file with it from a database query.
But when I try to run it I get the following error:
The script that I'm using is the following:
And there is no "strange" data in the Query. This is the result I get from the database: