Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2016-08-12
2
Medium Priority
?
66 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 2000 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

670 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