• 0
Sign in to follow this  
Guest Juliano Ballarini

Erro No Código... Sql + Vb6

Question

Guest Juliano Ballarini

Vou postar o Código, o erro e o design do banco, vê se voces conseguem me ajudar!

   
For i = 1 To cNumerarios.Count
      sTemp = cNumerarios.Item(i)
      sSql = "Select * from TITULOCR2 Where EMPCOD = " & igEmpresa & " And CLICOD = " & ClienteSel & " And TCRNUM = '" & sTitNum & "'"
      Set rdoRs1 = rdoCo.OpenResultset(sSql, rdOpenDynamic, rdConcurRowVer)
      Debug.Print sSql
      
      With rdoRs1
         .AddNew
         !EMPCOD = igEmpresa   
         !CLICOD = ClienteSel    
         !TCRNUM = sTitNum
         !TCR1DATA = Format(Date, "YYYY/MM/DD")
         !TCR2SEQ = i
         !NUMTIP = FirstPiece(sTemp, "~")
         If Val(!NUMTIP) <> NumDin Then
            !TCR2SIT = 1
         Else
            !TCR2SIT = 4
         End If
         !TCR2BAN = Val(FirstPiece(sTemp, "~"))       '!TCR2BAN = Val(FirstPiece(sTemp, "~"))
         !TCR2AGE = Val(FirstPiece(sTemp, "~"))       '!TCR2AGE = Val(FirstPiece(sTemp, "~"))
         !TCR2DOC = Val(FirstPiece(sTemp, "~"))       '!TCR2DOC = Val(FirstPiece(sTemp, "~"))
         !TCR2VAL = CCur(FirstPiece(sTemp, "~"))      '!TCR2VAL = CCur(FirstPiece(sTemp, "~"))
         !PORTCOD = iPortador
         If IsDate(Piece(sTemp, "~", 1)) Then
            !TCR2DATV = Format(FirstPiece(sTemp, "~"), "YYYY/MM/DD")
            Else
            !TCR2DATV = Format(Date, "YYYY/MM/DD")
         End If
         If Val(!NUMTIP) <> NumDin Then
            !TCR2DATC = Null
            Else
            !TCR2DATC = Format(Date, "YYYY/MM/DD")
         End If
         !TCR2DATD1 = Null                          '!TCR2DATD1 = Null
         !PORTCOD1 = Null                           '!PORTCOD1 = Null
         !TCR2DATDV1 = Null                         '!TCR2DATDV1 = Null
         !TCR2ALIN1 = Null                          '!TCR2ALIN1 = Null
         !TCR2DATD2 = Null                          '!TCR2DATD2 = Null
         !PORTCOD2 = Null                           '!PORTCOD2 = Null
         !TCR2DATDV2 = Null                         '!TCR2DATDV2 = Null
         !TCR2ALIN2 = Null                          '!TCR2ALIN2 = Null
         !TCR2ACR = Null                            '!TCR2ACR = Null
         !TCR2DES = Null                            '!TCR2DES = Null
         !TCR2RENG = Null                           '!TCR2RENG = Null
         !TCR2REND = Null                           '!TCR2REND = Null
         !TCR2OBS = Null                            '!TCR2OBS = Null
         !POTATU = iPortador
         !DATAT = Format(Date, "YYYY/MM/DD")
         !HORAT = Time
         !MAQAT = sgNomeEstacao
         !USUAT = igUsuario
         .Update
      End With ' ERRO AQUI
      
   Next i
Tabela do Banco de Dados ( MS SQL Server 2000 ) tbldesign.jpg Erro gerado: errocupom.jpg Código que gerou a mensagem de erro:
MsgBox Err.Number & " - " & Err.Description & vbNewLine & Err.Source & vbNewLine & vbNewLine & "Ocorreu um erro ao atualizar os arquivos.", vbCritical

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
Guest Juliano Ballarini

Eu já fiz um debug...

Quanfo chega no Update ele da erro!

ai vai pro TrataErros...

Não sei o que pode ser, já tentei de tudo...

:huh:

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this