Solved

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

Posted on 2016-08-12
2
59 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

617 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