Results 1 to 5 of 5

Thread: Execution Error -2147217887 ?????

  1. #1

    Thread Starter
    Lively Member Patrice Bourdages's Avatar
    Join Date
    Jun 2000
    Location
    Quebec, Canada
    Posts
    83

    Question

    I've got some kind of problem. I'm using a VB6 SP3 apps on a SQL Server v7.0 database.

    Considering the following Sub:

    Private Sub PetitRobert()
    Dim strCherche As String
    TableSigma.MoveFirst
    TableSigma.Find "NomTable = '" & mNomDeTable & "'", , adSearchForward
    If Not TableSigma.EOF Then
    Dictionnaire.MoveFirst
    strCherche = Mid(mNomDuChamp, 1, 5)
    Dictionnaire.Find "NomChamp = '" & strCherche & "'", , adSearchForward
    If Dictionnaire.EOF Then
    Dictionnaire.AddNew
    Dictionnaire!NomChamp = strCherche
    Dictionnaire!Description = mDescription
    Dictionnaire!TypeChamp = mTypeChamp
    Dictionnaire!Longueur = mLongueur
    Dictionnaire!Decimale = mDecimale
    Dictionnaire!EstUneDate = ""
    Dictionnaire!NouveauNom = ""
    Dictionnaire!NouvelleDescription = ""
    Dictionnaire.Update
    End If
    End If
    End Sub

    I've got the following error at runtime:

    Execution Error '-2147217887 (80040e21)'
    Multiple-step operation generated errors.
    Check each status value.

    The programs stops at the following line:
    Dictionnaire!NomChamp = strCherche

    What's wrong with my program??? If I try to manually add the data into SQL Server 7.0, no problem whatsoever...

    Thanks in advance for any advice or help.

    Sincerely, Patrice :-)

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    loop thru the Connection.Errors collection to get a specific description of the error

  3. #3

    Thread Starter
    Lively Member Patrice Bourdages's Avatar
    Join Date
    Jun 2000
    Location
    Quebec, Canada
    Posts
    83

    Unhappy

    Sure... ;-(

    How do I do that...?

    on error goto PetitRobertError

    ...

    PetitRobertError:
    msgbox ??????

    I'm not sure how to do that

    Could you help me out.

    Thanks :-)

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    Code:
        On Error GoTo Err_Handler
        
        Dim cn As ADODB.Connection
        Dim objError As ADODB.Error
        
        Set cn = New Connection
        
        cn.Open "Provider=SQLOLEDB;Data Source=WrongServerNameToGenerateError;UID=User;PWD=Password;Connect Timeout=2"
        
        'do other stuff here
        
        
        cn.Close
        Set cn = Nothing
        
        Exit Sub
        
    Err_Handler:
        'loop thru errors collection
        For Each objError In cn.Errors
            MsgBox objError.Description
        Next objError

  5. #5

    Thread Starter
    Lively Member Patrice Bourdages's Avatar
    Join Date
    Jun 2000
    Location
    Quebec, Canada
    Posts
    83

    Smile Thanks a Bunch

    Thank you very much...

    This kind of help is very appreciated.

    Sincerely yours,

    Patrice :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width