Hey guys,
At the moment i have an SQL database, that stores the names of the different organisational SQL databases in it. What i would like to know is if it is possible to open the first database, scan through the organisational names in it, add all these to a list of some sort, then procede to open these databases to retrieve some info from them?
I have tried using an array but have been told that it would not work like that.
If anone has some suggestions that would be great.
The following code is what i have now.
It always creates an error with opening the organisational database(s).
Dim OrgCustTotal', OrgCustTotalRS
SQL = "SELECT DISTINCT organisation FROM tbllogin WHERE loginType='blk'"
OrgCustTotal = 0
i = 0
OrgCustRS.Open SQL, objConn
Do While NOT OrgCustRS.EOF
OrgCustTotal = OrgCustTotal + 1
' response.write(OrgCustRS("organisation"
&" "
OrgCustRS.MoveNext
Loop
Response.write "<br><br><br>"
OrgCustRS.MoveFirst
dim OrgCust2RS,fld, j
SQL = "SELECT noUses FROM '"&(orgCustRS("organisation"
)&"'"
Set OrgCust2RS = objConn.Execute(SQL)
for each fld in OrgCustRS.fields
OrgTotalCust=0
OrgCustUses=0
j=0
Do While NOT OrgCust2RS.EOF
OrgTotalCust = OrgTotalCust + 1
OrgCustUses = j + OrgCust2RS("noUses"
j = OrgCustUses
OrgCust2RS.MoveNext
Loop
OrgCust2RS.Close
next
At the moment i have an SQL database, that stores the names of the different organisational SQL databases in it. What i would like to know is if it is possible to open the first database, scan through the organisational names in it, add all these to a list of some sort, then procede to open these databases to retrieve some info from them?
I have tried using an array but have been told that it would not work like that.
If anone has some suggestions that would be great.
The following code is what i have now.
It always creates an error with opening the organisational database(s).
Dim OrgCustTotal', OrgCustTotalRS
SQL = "SELECT DISTINCT organisation FROM tbllogin WHERE loginType='blk'"
OrgCustTotal = 0
i = 0
OrgCustRS.Open SQL, objConn
Do While NOT OrgCustRS.EOF
OrgCustTotal = OrgCustTotal + 1
' response.write(OrgCustRS("organisation"
OrgCustRS.MoveNext
Loop
Response.write "<br><br><br>"
OrgCustRS.MoveFirst
dim OrgCust2RS,fld, j
SQL = "SELECT noUses FROM '"&(orgCustRS("organisation"
Set OrgCust2RS = objConn.Execute(SQL)
for each fld in OrgCustRS.fields
OrgTotalCust=0
OrgCustUses=0
j=0
Do While NOT OrgCust2RS.EOF
OrgTotalCust = OrgTotalCust + 1
OrgCustUses = j + OrgCust2RS("noUses"
j = OrgCustUses
OrgCust2RS.MoveNext
Loop
OrgCust2RS.Close
next