Solved

How to  get result from TSQL to JavaSCript  using old classic ASP page ?

Posted on 2016-08-12
2
37 Views
Last Modified: 2016-09-23
We use classic ASP page
there is below vbscript code where :
1) invoiceResult  is VB Array
2)invoiceSql : stored proc on SQL server
3) ricoh  is company library which I cannot change ( no accsess)

 invoiceResult = ricoh.storedproc(invoiceSql
Question I need javascript array instead off vb6
Does not matter how I get it.
Can I transform somehow bv6 array to  javascript array?
Or  Can I use Ajax to get SQL data from classic ASP?
0
Comment
Question by:Yampolka
2 Comments
 
LVL 12

Accepted Solution

by:
funwithdotnet earned 500 total points
ID: 41755691
You can inject the results set directly into javascript. The VB runs before any javascript. You can use the VB array to populate data in any javascript script you like.

Something like ...
<%
dim delimiter = ""
dim jsString  = "var jsArray = ["
For each [item in VBArray]
 jsString &= delimiter & """" & [specific string item in VBArray] & """"
delimiter = ", "
Next
jsString  &= "];"
%>
<%=jsString%> <!-- Contains the completed javascript array declaration that can be injected in to any client-side script.-->

Open in new window

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This article discusses how to create an extensible mechanism for linked drop downs.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how the fundamental information of how to create a table.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now