Jump to content


spash

Member Since 25/05/2003
Offline Last Active 10/10/2009, 17:18
-----

Topics I've Started

Errona Contagem Total De Dados

09/10/2009, 19:44

Pessoal, to tentando contar todos os dados do meu banco de dados que possui várias tabelas.
Fiz o código abaixo mas nçao tá contando todos os dados. Somente alguns.

Onde foi que eu errei?

Grato a todos

<%

Dim totalBandas3, rst3, conn3, driver3, rst4, rst5, rst6, rst7, rst8, rst9, rst10, rst11, rst12, rst13, rst14, rst15, rst16, rst17, rst18, rst19, rst20, rst21, rst22, rst23, rst24, rst25, rst26, rst27, rst28, rst29, totalop, totalBandas4, totalBandas5, totalBandas6, totalBandas7, totalBandas8, totalBandas9, totalBandas10, totalBandas11, totalBandas12, totalBandas13, totalBandas14, totalBandas15, totalBandas16, totalBandas17, totalBandas18, totalBandas19, totalBandas20, totalBandas21, totalBandas22, totalBandas23, totalBandas24, totalBandas25, totalBandas26, totalBandas27, totalBandas28, totalBandas29

set conn3 = Server.CreateObject("ADODB.Connection")
driver3 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\clientes\digitalsub.com.br\wwwroot\bandas\operadoras.mdb;Persist Security Info=False"
conn3.Open driver3


Set rst3 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Acre")
Set rst4 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Alagoas")
Set rst5 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Amapa")
Set rst6 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Amazonas")
Set rst7 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Bahia")
Set rst8 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Brasília")
Set rst9 = conn3.Execute("SELECT COUNT(Operadora) As MailFROM Ceará")
Set rst10 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Espirito Santo")
Set rst11 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Goiás")
Set rst12 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Maranhão")
Set rst13 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Mato Grosso")
Set rst14 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Mato Grosso do Sul")
Set rst15 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Minas Gerais")
Set rst16 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Pará")
Set rst17 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Paraíba")
Set rst18 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Paraná")
Set rst19 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Pernambuco")
Set rst20 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Piauí")
Set rst21 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Rio de Janeiro")
Set rst22 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Rio Grande do Sul")
Set rst23 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Rio Grande do Norte")
Set rst24 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Rondônia")
Set rst25 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Roraima")
Set rst26 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Santa Catarina")
Set rst27 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM São Paulo")
Set rst28 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Sergipe")
Set rst29 = conn3.Execute("SELECT COUNT(Operadora) As Mail FROM Tocatins")

totalBandas3 = rst3("Mail")
totalBandas4 = rst4("Mail")
totalBandas5 = rst5("Mail")
totalBandas6 = rst6("Mail")
totalBandas7 = rst7("Mail")
totalBandas8 = rst8("Mail")
totalBandas9 = rst9("Mail")
totalBandas10 = rst10("Mail")
totalBandas11 = rst11("Mail")
totalBandas12 = rst12("Mail")
totalBandas13 = rst13("Mail")
totalBandas14 = rst14("Mail")
totalBandas15 = rst15("Mail")
totalBandas16 = rst16("Mail")
totalBandas17 = rst17("Mail")
totalBandas18 = rst18("Mail")
totalBandas19 = rst19("Mail")
totalBandas20 = rst20("Mail")
totalBandas21 = rst21("Mail")
totalBandas22 = rst22("Mail")
totalBandas23 = rst23("Mail")
totalBandas24 = rst24("Mail")
totalBandas25 = rst25("Mail")
totalBandas26 = rst26("Mail")
totalBandas27 = rst27("Mail")
totalBandas28 = rst28("Mail")
totalBandas29 = rst29("Mail")

totalop = totalBandas3 + totalBandas4 + totalBandas5 + totalBandas6 + totalBandas7 + totalBandas8 + totalBandas9 + totalBandas10 + totalBandas11 + totalBandas12 + totalBandas13 + totalBandas14 + totalBandas15 + totalBandas16 + totalBandas17 + totalBandas18 + totalBandas19 + totalBandas20 + totalBandas21 + totalBandas22 + totalBandas23 + totalBandas24 + totalBandas25 + totalBandas26 + totalBandas27 + totalBandas28 + totalBandas29

Set rst3 = Nothing
Set rst4 = Nothing
Set rst5 = Nothing
Set rst6 = Nothing
Set rst7 = Nothing
Set rst8 = Nothing
Set rst9 = Nothing
Set rst10 = Nothing
Set rst11 = Nothing
Set rst12 = Nothing
Set rst13 = Nothing
Set rst14 = Nothing
Set rst15 = Nothing
Set rst16 = Nothing
Set rst17 = Nothing
Set rst18 = Nothing
Set rst19 = Nothing
Set rst20 = Nothing
Set rst21 = Nothing
Set rst22 = Nothing
Set rst23 = Nothing
Set rst24 = Nothing
Set rst25 = Nothing
Set rst26 = Nothing
Set rst27 = Nothing
Set rst28 = Nothing
Set rst29 = Nothing
Set conn3 = Nothing

Response.Write("<b>Operadoras cadastradas:</b> ") & totalop

%>

Obrigado a todos...

IPB Skin By Virteq