USUÁRIO:      SENHA:        SALVAR LOGIN ?    Adicione o VBWEB na sua lista de favoritos   Fale conosco 

 

  Fórum

  Visual Basic
Voltar
Autor Assunto:  Verificar se a tabela está vazia
rlinop
PORTO ALEGRE
RS - BRASIL
Postada em 02/12/2004 14:05 hs            

Olá gente.. Algém sabe me dizer como eu faço pra verificar se a tabela está vazia ??? Tipo eu já tentei usar RecordCount mas nada disso funciona.. Alguém tem alguma idéia ???? Agradecido..

Oks,
Rafael Portal

 
     
Martini
Pontos: 2843 Pontos: 2843
PAROBÉ
RS - BRASIL
Postada em 02/12/2004 14:09 hs         
Select Count(*) AS NReg From ZAR010
 
     
ghost_jlp
Pontos: 2843 Pontos: 2843 Pontos: 2843 Pontos: 2843
SÃO PAULO
SP - BRASIL
Postada em 02/12/2004 14:21 hs            
Vc pode também fazer uma verificação...
 
...
Dim RS as ADODB.Recordset
...
 
if RS.EOF and RS.BOF then msgbox "Não existem registros na tabela!",vbCritical
 
Se caso for fim e começo de arquivo quer dizer q não existem registros ok?
 
t+
     
DM MASTER
SÃO PAULO
SP - BRASIL
Postada em 02/12/2004 14:32 hs            
select * from tabela
if recordset=0 --> a tabela esta vazia
else --> a tabela contem registros

DM MASTER":.
     
Keyo
Pontos: 2843
CURITIBA
PR - BRASIL
Postada em 02/12/2004 16:59 hs            
if rs.eof = true then
        msgbox "Nenhum Registro foi Localizado.",vbinformation,"Consulta"
        rs.close
        exit sub
else
        'segue a rotina
end if
     
Rinaldo
SÃO PAULO
SP - BRASIL
Postada em 03/12/2004 08:28 hs            
Tente assim
 
private sub Command1_Click()
If tabela.recordcount = 0 then
      exit sub
EndIf
End Sub
     
Página(s): 1/1    


Seu Nome:

Seu eMail:

ALTERAR PARA MODO HTML
Mensagem:

[:)] = 
[:P] = 
[:(] = 
[;)] = 

HTML DESLIGADO

     
 VOLTAR

  



CyberWEB Network Ltda.    © Copyright 2000-2025   -   Todos os direitos reservados.
Powered by HostingZone - A melhor hospedagem para seu site
Topo da página