These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Populating a Javascript array from SQL database values

atc12345
Registered: Apr 1 2008
Posts: 4
Answered

Can anyone help with this issue.
I'm trying to populate a JavaScript array using values from an SQL database table.

My hardcoded array (which works) looks like this:

EmpNumber=new Array(111,222,333,444);

When I try to populate the array with values from an SQL database:

<%

Dim sql,Rs1

sql = ""
sql = sql & "SELECT EmpNumber FROM EmpFile "
Set Rs1 = Server.CreateObject("ADODB.Recordset")
Rs1.Open sql, DecryptedText(TheFile,"ConSQL"), 3
%>

EmpNumber=new Array(<%=Rs1("EmpNumber")%>);

I don't get an error message, but neither do I get any results. Any suggestions?

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
This forum is for Acrobat JavaScript issues, and it looks like you have an HTML JavaScript question. I'm sorry, but you'll need to try somewhere else.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script