jorkin / aspjson

Automatically exported from code.google.com/p/aspjson
0 stars 0 forks source link

Missing array elements #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

    sql = "SELECT DISTINCT mv.F0 FROM MatrixValidation mv WHERE 
mv.MatrixID = 1 ORDER BY mv.F0" 

    dbCon.Open()
    Set rsReturn = dbCon.Execute(sql)   
    arr = rsReturn.GetRows()
    dbCon.Close()

    Response.Write toJSON(arr)

What is the expected output? What do you see instead?
[["Master of Education: Technology in Education","Master of Health 
Services Administration","Master of Public Administration","Master of 
Science in Professional Accounting: Accounting Information 
Systems","Master of Science in Professional Accounting: 
Controllership","Master of Science in Professional Accounting: 
Taxation","MBA: Information Systems Management Concentration","MBA: 
Accounting Concentration","MBA: Acquisition","MBA: Finance","MBA: 
Healthcare Concentration","MBA: Hospitality and Tourism Management","MBA: 
Human Resource Management","MBA: International Business 
Concentration","MBA: Management","MBA: Marketing","MBA: Professional 
Studies Concentration","MBA: Project Management Concentration","MBA: 
Public Administration Concentration","MBA: Supply Chain Management","MSIS: 
Computer Security Management","MSIS: Decision Support System 
Management","MSIS: Enterprise Resource Management","MSIS: Network 
Management","MSIS: Software Engineering Management","MSIS: Systems 
Development Management"]]

JSON_2.0.2.asp output
[["Master of Education: Educational Management","Master of Education: 
Technology in Education","Master of Health Services 
Administration","Master of Public Administration","Master of Science in 
Professional Accounting: Accounting Information Systems","Master of 
Science in Professional Accounting: Controllership","Master of Science in 
Professional Accounting: Taxation","MBA: Information Systems Management 
Concentration","MBA: Accounting Concentration","MBA: 
Acquisition",,,,,,,,,,,,,,,,,]]

What version of the product are you using? On what operating system?
JSON_2.0.2 SERVER 2003\XP

Please provide any additional information below.

Original issue reported on code.google.com by JoePPerk...@gmail.com on 3 Feb 2009 at 3:10

GoogleCodeExporter commented 9 years ago
Array render function have a problem.
http://code.google.com/p/aspjson/issues/detail?id=4&can=1

You may use to alternative method temoprary. For example

sql = "SELECT DISTINCT mv.F0 FROM MatrixValidation mv WHERE 
mv.MatrixID = 1 ORDER BY mv.F0" 

dbCon.Open()
Set jsReturn = QueryToJSON(dbCon.Execute(sql), sql)    
dbCon.Close()

For Each jsProp in jsReturn.Collection
    jsReturn(jsProp) = jsReturn(jsProp)("F0")
Next

jsReturn.Flush  ' or Response.Write jsReturn.jsString

Original comment by tugrulto...@gmail.com on 4 Feb 2009 at 11:57

GoogleCodeExporter commented 9 years ago
replace
Set jsReturn = QueryToJSON(dbCon.Execute(sql), sql)  

with
Set jsReturn = QueryToJSON(dbCon, sql) 

Original comment by tugrulto...@gmail.com on 4 Feb 2009 at 11:59

GoogleCodeExporter commented 9 years ago
tugrultopuz,

I have provided a working solution for this problem under Issue 9. Please merge 
it 
into your code if it is acceptable. 

Thank you for all your work

Cheers,
Mark

Original comment by mark.pal...@gmail.com on 3 Jul 2009 at 10:01

GoogleCodeExporter commented 9 years ago

Original comment by tugrulto...@gmail.com on 9 Nov 2009 at 11:06