JElster
asked on
REST service in Classic ASP ?
How can I create a rest service in old classic asp. Or create asp page that will serve or provide data that can be used
with JQUERY to read the data. Use an ASP page as the DAL and have have HTML page and JQuery read from the asp
page and populate a grid.
with JQUERY to read the data. Use an ASP page as the DAL and have have HTML page and JQuery read from the asp
page and populate a grid.
ASKER
I need to query a DB.. I guess using
Set connection = Server.CreateObject("ADODB .Connectio n")
and get a dataset.
Then how do I have jquery read / parse the dataset?
Using Kendo UI grid or someother Jquery grid.. not sure.
thx
Set connection = Server.CreateObject("ADODB
and get a dataset.
Then how do I have jquery read / parse the dataset?
Using Kendo UI grid or someother Jquery grid.. not sure.
thx
are you trying to build a REST service or consume one?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.. it is possible to include all the code in one ASP file? Or do I need a separate 'userSearch.asp' and another HTML or ASP page?
You will need 2 pages and it looks like Big Monty is leading you to making your ajax page http:Q_28480375.html#a40209467
Then you will need a main page as well.
Then you will need a main page as well.
ASKER
Any idea how I can add more than one query on a page..
<!--#include virtual = "/includes/plugins/aspJSON /JSON_2.0. 4.asp"-->
<!--#include virtual = "/includes/plugins/aspJSON /JSON_UTIL _0.1.1.asp "-->
<%
Set conn = Server.CreateObject("ADODB .Connectio n")
conn.Open connectionString
sql = "select * from table"
QueryToJSON( conn, sql ).Flush
if conn.State <> 0 then conn.Close
set conn = nothing
%>
<!--#include virtual = "/includes/plugins/aspJSON
<!--#include virtual = "/includes/plugins/aspJSON
<%
Set conn = Server.CreateObject("ADODB
conn.Open connectionString
sql = "select * from table"
QueryToJSON( conn, sql ).Flush
if conn.State <> 0 then conn.Close
set conn = nothing
%>
sql = "SELECT * FROM table WHERE some_field = 'foo'"
or
foo = request.querystring("bar")
sql = "SELECT * FROM table WHERE some_field = '"&foo&"'"
or
foo = request.querystring("bar")
sql = "SELECT * FROM table WHERE some_field = '"&foo&"'"
ASKER
How can I have more than of these on page...
sql = "select * from Customers"
QueryToJSON( conn, sql ).Flush
sql = "select * from Orders"
QueryToJSON( conn, sql ).Flush
sql = "select * from Customers"
QueryToJSON( conn, sql ).Flush
sql = "select * from Orders"
QueryToJSON( conn, sql ).Flush
If request.querystring("type")="customers" then
sql = "select * from Customers"
else
sql = "select * from Orders"
end if
QueryToJSON( conn, sql ).Flush
Open in new window
with this bit of code, you now have all of the data in a variable called results.
all you have to do is make an ajax call to that bit of code:
Open in new window
what kind of grid are you using and what format do you expect the data returned as?