Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6084791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:33:50+00:00 2026-05-23T11:33:50+00:00

I want to create a multidimensional array with 2 columns and have the row

  • 0

I want to create a multidimensional array with 2 columns and have the row size a dynamic value. I then want to populate the multidimensional array with values from 2 different SQL queries (Microsoft).

The problem is That when the page loads it seems to be empty. How can Fill each column with he two different recordsets?

Or

At least return the total number of rows in the recordset?

Code below –

 connectionstring = obj_ADO.getconnectionstring
    Set objCon = CreateObject("ADODB.Connection")
    Set objRS = CreateObject("ADODB.Recordset")
    set objComm = CreateObject("ADODB.Command")
    objCon.Open connectionstring

    objComm.ActiveConnection = objCon.ConnectionString
    objComm.CommandText = "A_Page_Paging"
    objComm.CommandType = adCmdStoredProc

    Set objParameter = objComm.CreateParameter
    objParameter.Name = "selected_Char"
    objParameter.Type = adChar
    objParameter.Direction = adParamInput
    objParameter.Size = 3
    objParameter.Value = Selected_Button
    objComm.Parameters.Append objParameter

    set objRS = objComm.Execute

    Increment = 0
    Dim testArray()
    while not objRS.EOF      

    Redim testArray(2, increment)
 '--------------------------------------------

                    Page_ID = objRS("P_PageID")
                    connectionstring = obj_ADO.getconnectionstring

                    Set objConn = CreateObject("ADODB.Connection")
                    Set objRSS = CreateObject("ADODB.Recordset")
                    objConn.Open connectionstring

                    SQL = "Select P_Name as P_Name, P_Description as P_Description from L_PagePermission inner join A_Permission on p_permissionID = pp_PermissionID inner join A_Page on P_PageID = PP_PageID where P_PageID =" & Page_ID & " order by p_Name"                          
                    objRSS.open SQL, objConn


                    if not objRSS.EOF then                                            
                        objRSS.MoveFirst
                        while not objRSS.EOF

                        'Fill Array
                        testArray(0, increment) = objRS("P_PageID")

                        objRSS.MoveNext
                    wend

                    objRSS.close
                    objConn.close

                    else
                        testArray(0, increment) = "-"              
                    end if     

                    Increment = Increment + 1                                   
                '--------------------------------------------                                       
                    %>                      

        <%
            objRS.MoveNext
            wend

            objRS.Close
            objCon.Close  


            response.Write testArray(0,5)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:33:51+00:00Added an answer on May 23, 2026 at 11:33 am

    Figured it out myself by using preseve in the redim of my array so the code below fixed my problem –

    '--------------------------------------------   
            Increment = 0
            Dim testArray()                  
            connectionstring = obj_ADO.getconnectionstring
    
    
            Set objConn = CreateObject("ADODB.Connection")
            Set objRSS = CreateObject("ADODB.Recordset")
            objConn.Open connectionstring
    
            SQL = "select * from a_permission inner join L_PagePermission on P_PermissionID = PP_PermissionID inner join A_Page on P_PageID = PP_PageID order by P_Name"                          
            objRSS.open SQL, objConn
    
    
            if not objRSS.EOF then                                            
                objRSS.MoveFirst
                while not objRSS.EOF
    
                Redim Preserve testArray(2, increment)              
                'Two Dimensional Array
                testArray(0, increment) = objRSS("P_PageID")
                testArray(1, increment) = objRSS("P_Name")
    
                objRSS.MoveNext
                Increment = Increment + 1    
            wend
    
            objRSS.close
            objConn.close
    
            else
                testArray(0, increment) = "-"
                testArray(1, increment) = "-"            
            end if     
    
        '--------------------------------------------       
    
    
    
                    '--------------------------------------------
                        Page_ID = objRS("P_PageID")
    
                        for i = 0 to (increment - 1)
                            if testArray(0, i) = Page_ID then
                         %>                    
                            <li style="" ="padding:0;margin:0;"><%=testArray(1,i)%></li>
                        <%
    
                            end if
    
                        next
    
                    '--------------------------------------------  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a Python dictionary which holds values in a multidimensional array
I want to create a multidimensional array with just two values : 0 or
I have a multidimensional array and I want to create new variables based on
I want to dynamic create an array based on a number inside a multidimensional
I have a flat array that I'm trying to make multidimensional. Basically, I want
I have this 2d dynamic array and I want to pass it to a
I want to create a nested array or multidimensional array. In my data is,
I want to create multidimensional array which has levels, groups and items.
I have create following string multidimensional array in java. which has top outer array
I want to create a multidimensional array based on a string. the string has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.