ADODB Connection Visual Basic 2008

I´m receiving an error while updating access data base using adodb.
AccessConnect2 = "Driver={Microsoft Access Driver (*.mdb)};" & _
                      "Dbq=dados.mdb;" & _
                      "DefaultDir=e:\dados;" & _
            Conn2.ConnectionString = AccessConnect

            xmat = Rs1.Fields("Matricula").Value
            Xsql = "Select * from " & TextARQ.Text.ToString & " where MAT=" & CStr(xmat)
            Rs2 = Conn2.Execute(Xsql)

            If Not Rs2.EOF Then

                Rs2.Fields("AT").Value = "S"

This update generate an error ..
Jose BredariolPMPAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Can you tell us what error you are receiving and at what line it occurs? It's hard to say what the problem might be otherwise. Does the user Admin have a password? You haven't supplied one. Is the field MAT a string field? You haven't put quotes around it in the line:

       Xsql = "Select * from " & TextARQ.Text.ToString & " where MAT=" & CStr(xmat)

(Should this be:)?

        Xsql = "Select * from " & TextARQ.Text.ToString & " where MAT='" & CStr(xmat) & "'"

What's the value of TextARQ.Text.ToString? Is this a valid tablename? Does it contain the field "AT"?
There are all kinds of potential problems here, but it's hard to say what your problem is without an error message.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jose BredariolPMPAuthor Commented:
VB error 0
generated by description
The error is on update process. While debugging the update line gos to the Adoerror procedure :
        i = 1
        On Error Resume Next

        ' Enumerate Errors collection and display properties of
        ' each Error object (if Errors Collection is filled out)
        Errs1 = Conn1.Errors
        For Each errLoop In Errs1
            With errLoop
                strTmp = strTmp & vbCrLf & "ADO Error # " & i & ":"
                strTmp = strTmp & vbCrLf & "   ADO Error   # " & .Number
                strTmp = strTmp & vbCrLf & "   Description   " & .Description
                strTmp = strTmp & vbCrLf & "   Source        " & .Source
                i = i + 1
            End With
Jose BredariolPMPAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.