|
-
Jun 28th, 2000, 01:37 AM
#1
Thread Starter
Lively Member
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 :-)
-
Jun 28th, 2000, 12:08 PM
#2
Guru
loop thru the Connection.Errors collection to get a specific description of the error
-
Jun 28th, 2000, 07:18 PM
#3
Thread Starter
Lively Member
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 :-)
-
Jun 28th, 2000, 11:21 PM
#4
Guru
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
-
Jun 28th, 2000, 11:43 PM
#5
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|