Ir para conteúdo
Fórum Script Brasil
  • 0

Código do vb 6 para o vb 2010


Oteniel VB

Pergunta

Public Class CadFuncionario
Dim VeriFI As Boolean
Dim Tabfun As New ADODB.Recordset
Private Sub CadFuncionario_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'On Error Resume Next
CONEXAO = New ADODB.Connection
CONEXAO.Open("DSN=os", , "jacare")
Call AtualizaFuncionario()
If Tabfun.RecordCount > 0 Then
Call BuscaFuncionario(Tabfun.Fields("CodFuncio").Value)
End If
End Sub
Private Sub AtualizaFuncionario()
Tabfun = New ADODB.Recordset
Tabfun.ActiveConnection = CONEXAO
Tabfun.Source = "select * from TBFucionario"
Tabfun.CursorType = CursorTypeEnum.adOpenKeyset
Tabfun.LockType = LockTypeEnum.adLockOptimistic
Tabfun.Open()
End Sub
Private Sub BuscaFuncionario(ByVal cod As Long)
'On Error Resume Next
Dim Tabfun As ADODB.Recordset
Tabfun = New ADODB.Recordset
Tabfun.ActiveConnection = CONEXAO
Tabfun.Source = "select * from TBFucionario where CodFuncio=" & cod
Tabfun.CursorType = CursorTypeEnum.adOpenKeyset
Tabfun.LockType = LockTypeEnum.adLockOptimistic
Tabfun.Open()
If Tabfun.RecordCount > 0 Then
FuCodigo.Text = Format(Tabfun.Fields("CodFuncio").Value, "000#")
' FuNome.Text = IIf(IsNull(Tabfun.Fields("Funcionario")), "", Tabfun.Fields("Funcionario"))
' CPF.Text = IIf(IsNull(Tabfun.Fields("CPF")), "", Tabfun.Fields("CPF"))
' RG.Text = IIf(IsNull(Tabfun.Fields("rg")), "", Tabfun.Fields("rg"))
' DataNasc.Text = IIf(IsNull(Tabfun.Fields("DataNasc")), "", Tabfun.Fields("DataNasc"))
' DataNasc.Text = Format(DataNasc.Text, "dd/mm/yyyy")
' Endereco.Text = IIf(IsNull(Tabfun.Fields("Endereco")), "", Tabfun.Fields("Endereco"))
' Numero.Text = IIf(IsNull(Tabfun.Fields("Numero")), "", Tabfun.Fields("Numero"))
' Bairro.Text = IIf(IsNull(Tabfun.Fields("Bairro")), "", Tabfun.Fields("Bairro"))
' Referencia.Text = IIf(IsNull(Tabfun.Fields("Referencia")), "", Tabfun.Fields("Referencia"))
'Cidade.Text = IIf(IsNull(Tabfun.Fields("Cidade")), "", Tabfun.Fields("Cidade"))
' UF.Text = IIf(IsNull(Tabfun.Fields("UF")), "", Tabfun.Fields("UF"))
' Telefone.Text = IIf(IsNull(Tabfun.Fields("Telefone")), "", Tabfun.Fields("Telefone"))
' Celular.Text = IIf(IsNull(Tabfun.Fields("Celular")), "", Tabfun.Fields("Celular"))
' Email.Text = IIf(IsNull(Tabfun.Fields("Email")), "", Tabfun.Fields("Email"))
' sexo.Text = IIf(IsNull(Tabfun.Fields("Sexo")), "", Tabfun.Fields("Sexo"))
' estadocivil.Text = IIf(IsNull(Tabfun.Fields("EstadoCivil")), "", Tabfun.Fields("EstadoCivil"))
' CEP.Text = IIf(IsNull(Tabfun.Fields("CEP")), "", Tabfun.Fields("CEP"))
' Login.Text = IIf(IsNull(Tabfun.Fields("Login")), "", Tabfun.Fields("Login"))
' SenhaEntrada.Text = IIf(IsNull(Tabfun.Fields("Senha")), "", Tabfun.Fields("Senha"))
' Acesso.Caption = IIf(IsNull(Tabfun.Fields("login")), "", Tabfun.Fields("login"))
Else
' Funcionario.Text = ""
' CPF.Text = ""
' Endereco.Text = ""
' Bairro.Text = ""
''Cidade.Text = ""
' CEP.Text = ""
' RG.Text = ""
' DataNasc.Text = ""
' Referencia.Text = ""
' Celular.Text = ""
' Telefone.Text = ""
' Numero.Text = ""
' Email.Text = ""
' UF.Text = ""
' sexo.Text = ""
' estadocivil.Text = ""
' Login.Text = ""
'SenhaEntrada.Text = ""
'F() 'rame3.Visible = False
' Frame2.Top = 4080
' CadFucionario.Height = 5340
Tabfun.Close()
Tabfun = Nothing
End If
End Sub
End Class
Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

  • 0

<script type='text/javascript'>window.mod_pagespeed_start = Number(new Date());</script>

Public Class CadFuncionario
Dim VeriFI As Boolean
Dim Tabfun As New ADODB.Recordset
Private Sub CadFuncionario_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'On Error Resume Next
CONEXAO = New ADODB.Connection
CONEXAO.Open("DSN=os", , "jacare")
Call AtualizaFuncionario()
If Tabfun.RecordCount > 0 Then
Call BuscaFuncionario(Tabfun.Fields("CodFuncio").Value)
End If
End Sub
Private Sub AtualizaFuncionario()
Tabfun = New ADODB.Recordset
Tabfun.ActiveConnection = CONEXAO
Tabfun.Source = "select * from TBFucionario"
Tabfun.CursorType = CursorTypeEnum.adOpenKeyset
Tabfun.LockType = LockTypeEnum.adLockOptimistic
Tabfun.Open()
End Sub
Private Sub BuscaFuncionario(ByVal cod As Long)
'On Error Resume Next
Dim Tabfun As ADODB.Recordset
Tabfun = New ADODB.Recordset
Tabfun.ActiveConnection = CONEXAO
Tabfun.Source = "select * from TBFucionario where CodFuncio=" & cod
Tabfun.CursorType = CursorTypeEnum.adOpenKeyset
Tabfun.LockType = LockTypeEnum.adLockOptimistic
Tabfun.Open()
If Tabfun.RecordCount > 0 Then
FuCodigo.Text = Format(Tabfun.Fields("CodFuncio").Value, "000#")
' FuNome.Text = IIf(IsNull(Tabfun.Fields("Funcionario")), "", Tabfun.Fields("Funcionario"))
' CPF.Text = IIf(IsNull(Tabfun.Fields("CPF")), "", Tabfun.Fields("CPF"))
' RG.Text = IIf(IsNull(Tabfun.Fields("rg")), "", Tabfun.Fields("rg"))
' DataNasc.Text = IIf(IsNull(Tabfun.Fields("DataNasc")), "", Tabfun.Fields("DataNasc"))
' DataNasc.Text = Format(DataNasc.Text, "dd/mm/yyyy")
' Endereco.Text = IIf(IsNull(Tabfun.Fields("Endereco")), "", Tabfun.Fields("Endereco"))
' Numero.Text = IIf(IsNull(Tabfun.Fields("Numero")), "", Tabfun.Fields("Numero"))
' Bairro.Text = IIf(IsNull(Tabfun.Fields("Bairro")), "", Tabfun.Fields("Bairro"))
' Referencia.Text = IIf(IsNull(Tabfun.Fields("Referencia")), "", Tabfun.Fields("Referencia"))
'Cidade.Text = IIf(IsNull(Tabfun.Fields("Cidade")), "", Tabfun.Fields("Cidade"))
' UF.Text = IIf(IsNull(Tabfun.Fields("UF")), "", Tabfun.Fields("UF"))
' Telefone.Text = IIf(IsNull(Tabfun.Fields("Telefone")), "", Tabfun.Fields("Telefone"))
' Celular.Text = IIf(IsNull(Tabfun.Fields("Celular")), "", Tabfun.Fields("Celular"))
' Email.Text = IIf(IsNull(Tabfun.Fields("Email")), "", Tabfun.Fields("Email"))
' sexo.Text = IIf(IsNull(Tabfun.Fields("Sexo")), "", Tabfun.Fields("Sexo"))
' estadocivil.Text = IIf(IsNull(Tabfun.Fields("EstadoCivil")), "", Tabfun.Fields("EstadoCivil"))
' CEP.Text = IIf(IsNull(Tabfun.Fields("CEP")), "", Tabfun.Fields("CEP"))
' Login.Text = IIf(IsNull(Tabfun.Fields("Login")), "", Tabfun.Fields("Login"))
' SenhaEntrada.Text = IIf(IsNull(Tabfun.Fields("Senha")), "", Tabfun.Fields("Senha"))
' Acesso.Caption = IIf(IsNull(Tabfun.Fields("login")), "", Tabfun.Fields("login"))
Else
' Funcionario.Text = ""
' CPF.Text = ""
' Endereco.Text = ""
' Bairro.Text = ""
''Cidade.Text = ""
' CEP.Text = ""
' RG.Text = ""
' DataNasc.Text = ""
' Referencia.Text = ""
' Celular.Text = ""
' Telefone.Text = ""
' Numero.Text = ""
' Email.Text = ""
' UF.Text = ""
' sexo.Text = ""
' estadocivil.Text = ""
' Login.Text = ""
'SenhaEntrada.Text = ""
'F() 'rame3.Visible = False
' Frame2.Top = 4080
' CadFucionario.Height = 5340
Tabfun.Close()
Tabfun = Nothing
End If
End Sub
End Class

Estes código não esta funcionado , alguém pode me ajudar encontra o erro

Editado por Oteniel VB
Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      652k
×
×
  • Criar Novo...