Kispeto
<%
fEmptyRecordset2 = False
Set cmdTemp = Server.CreateObject("ADODB.Command")
Set Regioes = Server.CreateObject("ADODB.Recordset")
cmdTemp.CommandText = "SELECT * FROM regioes where status = 'A' order by regiao"
cmdTemp.CommandType = 1
Set cmdTemp.ActiveConnection = teste1
Regioes.Open cmdTemp, , 1, 3
On Error Resume Next
If Regioes.BOF And Regioes.EOF Then fEmptyRecordset2 = True
On Error Goto 0
If Err Then fEmptyRecordset2 = True
wkqtd1 = Regioes.recordCount + 1
%>
<%
fEmptyRecordset3 = False
Set cmdTemp = Server.CreateObject("ADODB.Command")
Set Bairros = Server.CreateObject("ADODB.Recordset")
cmdTemp.CommandText = "SELECT * FROM bairros where status= 'A' order by bairro"
cmdTemp.CommandType = 1
Set cmdTemp.ActiveConnection = teste1
Bairros.Open cmdTemp, , 1, 3
On Error Resume Next
If Bairros.BOF And Bairros.EOF Then fEmptyRecordset3 = True
On Error Goto 0
If Err Then fEmptyRecordset3 = True
wkqtd2 = Bairros.recordCount
Bairros.close
%>