artsapimp
Jul 27th, 2000, 03:42 PM
I have been working on a page and have battled a number of errors. I think I've fixed it since there is no errors now, but there is also no output. I've tried to use a few response.write lines but they don't seem to be working either. Please look at this script and tell me how to test this script to see if it's grabbing the information correctly?
Thanks
<% option explicit %>
<%
Response.Buffer=True
Dim strSQL1
Dim strSQL2
Dim strSQL3
Dim intStates
Dim strStateName
Dim intFieldCounter
Dim cnn
Dim rst
Dim connectString
Dim x
Dim intNumberofStateRecords
Dim intNumberofCityRecords
Dim intNumberofDslamRecords
set cnn = Server.CreateObject ("ADODB.Connection")
set rst = Server.CreateObject ("ADODB.Recordset")
ConnectString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\shared webs\art\new1\dslams\dslams.mdb"
cnn.open connectString
' here are my database tables
strSQL1 = "SELECT * FROM States"
strSQL2 = "SELECT * From Cities"
strSQL3 = "SELECT * FROM Dslams"
'Get Number of States
rst.open "SELECT Count(*) AS intNumberofStateRecords FROM States", cnn
rst.close
'Get Number of Citites
rst.open "SELECT Count(*) AS intNumberofCityRecords FROM Cities", cnn
rst.close
'Get Number of DSLAMS
rst.open "SELECT Count(*) AS intNumberofDslamRecords FROM DSLAMS", cnn
rst.close
'Get the States
rst.open strSQL1, cnn
for intFieldCounter = 0 to intNumberofStateRecords -1
strStateName(intFieldCounter) = rst("StateName")
intStateID(intFieldCounter) = rst("StateID")
x=x+1
rst.MoveNext
response.write(strStateName(intFieldCounter)&"<br>")
next
rst.close
'Get the Cities
rst.open strSQL2, cnn
for intFieldCounter = 0 to intNumberofCityRecords -1
strCityName(intFieldCounter) = rst("CityName")
intCStateID(intFieldCounter) = rst("StateID")
intCityID(intFieldCounter) = rst("CityID")
x = x + 1
rst.MoveNext
next
rst.close
'Get the Dslamss
rst.open strSQL3, cnn
for intFieldCounter = 0 to intNumberofDslamRecords -1
strCLLI(intFieldCounter) = rst("CLLI")
intDSLAMID(intFieldCounter) = rst("DSLAMID")
intCLLICityID(intFieldCounter) = rst("CityID")
x = x + 1
rst.MoveNext
next
rst.close
cnn.close
response.end
%>
[Edited by artsapimp on 07-27-2000 at 05:44 PM]
Thanks
<% option explicit %>
<%
Response.Buffer=True
Dim strSQL1
Dim strSQL2
Dim strSQL3
Dim intStates
Dim strStateName
Dim intFieldCounter
Dim cnn
Dim rst
Dim connectString
Dim x
Dim intNumberofStateRecords
Dim intNumberofCityRecords
Dim intNumberofDslamRecords
set cnn = Server.CreateObject ("ADODB.Connection")
set rst = Server.CreateObject ("ADODB.Recordset")
ConnectString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\shared webs\art\new1\dslams\dslams.mdb"
cnn.open connectString
' here are my database tables
strSQL1 = "SELECT * FROM States"
strSQL2 = "SELECT * From Cities"
strSQL3 = "SELECT * FROM Dslams"
'Get Number of States
rst.open "SELECT Count(*) AS intNumberofStateRecords FROM States", cnn
rst.close
'Get Number of Citites
rst.open "SELECT Count(*) AS intNumberofCityRecords FROM Cities", cnn
rst.close
'Get Number of DSLAMS
rst.open "SELECT Count(*) AS intNumberofDslamRecords FROM DSLAMS", cnn
rst.close
'Get the States
rst.open strSQL1, cnn
for intFieldCounter = 0 to intNumberofStateRecords -1
strStateName(intFieldCounter) = rst("StateName")
intStateID(intFieldCounter) = rst("StateID")
x=x+1
rst.MoveNext
response.write(strStateName(intFieldCounter)&"<br>")
next
rst.close
'Get the Cities
rst.open strSQL2, cnn
for intFieldCounter = 0 to intNumberofCityRecords -1
strCityName(intFieldCounter) = rst("CityName")
intCStateID(intFieldCounter) = rst("StateID")
intCityID(intFieldCounter) = rst("CityID")
x = x + 1
rst.MoveNext
next
rst.close
'Get the Dslamss
rst.open strSQL3, cnn
for intFieldCounter = 0 to intNumberofDslamRecords -1
strCLLI(intFieldCounter) = rst("CLLI")
intDSLAMID(intFieldCounter) = rst("DSLAMID")
intCLLICityID(intFieldCounter) = rst("CityID")
x = x + 1
rst.MoveNext
next
rst.close
cnn.close
response.end
%>
[Edited by artsapimp on 07-27-2000 at 05:44 PM]