Using JSON_UTIL_latest.asp with Microsoft SQLServer

335 views
Skip to first unread message

Steve

unread,
Sep 25, 2012, 1:27:06 PM9/25/12
to asp...@googlegroups.com
Hi there,
 
Using the sample on the site...
 
<!--#include file="JSON_latest.asp"-->
 
<!--#include file="JSON_UTIL_latest.asp"-->
<%
QueryToJSON(dbconn, "SELECT name, surname FROM members WHERE age < 30").Flush
%>
 
I replaced my database connection string in the red bit above and I replaced my SQL statement in the blue bit; hoping that was all that was needed... but instead of getting nice pretty JSON data out, I got the following error. Anyone have any ideas what I am missing ?
 

Microsoft VBScript runtime

error '800a01a8'

Object required: 'dbc'

/json/JSON_UTIL_latest.asp, line 4

I then dug around in the file mentioned in orange, and noticed that there is no line like Set dbc = Server.CreateObject ("ADODB.Command") - which I would imagine is required to make this code work.

Any ideas would be greatly appreciated.

Regards

Steve

Tuğrul Topuz

unread,
Sep 25, 2012, 1:56:51 PM9/25/12
to asp...@googlegroups.com
You should create "ADODB.Connection" and set connection string and open connection.
You can reach informations following pages.

http://www.w3schools.com/ado/ado_connect.asp
http://www.connectionstrings.com/

25.09.2012 20:27 tarihinde, Steve yazdı:
Reply all
Reply to author
Forward
0 new messages