Results 1 to 7 of 7

Thread: Error trapping

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Ireland
    Posts
    224

    Question

    Hi guys
    I'm getting an error with a number of 8004oe14. Can someone plese tell me how to write an error trap for this error number.
    Thanks a lot
    JK

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Hi kanejone,
    can you tell us what you were doing when you got this error please?

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Ireland
    Posts
    224

    Cool

    Hi alex_read
    What I'm doing is trying to connect to a database. The problem is that I am importing data from text files. I have about 50,000 files and there are some duplicates of file names but the data in the files are all different. So what I am trying do is figure a way around this. Any suggestions would be really helpful!!!
    Thanks
    JK


  4. #4
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    I looked on MSDN for this, and there was a similar code for an ADO error. You could try the site I was pointed to if you are using ADO :
    http://www.msdn.microsoft.com/librar..._adorosest.htm

    Otherwise, can you post your code here & we can see if we can help (if you are using DAO or SQL I may be able to help, if it's ADO, post anyway & someone else will look at this and help - please guys!)

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  5. #5
    Member
    Join Date
    Oct 2000
    Location
    Netherlands
    Posts
    54

    Smile Trap it

    I use this standard code for Error trapping. If there's a description kown you'll get it from VB. ADO error descriptions are much better these days.

    Code:
    Private sub Whatever()
    On Error Goto WhatEH
    
    'do you stuff here
        Exit Sub
    WhatEH:
        Screen.MousePointer = vbNormal
        Select Case Err.Number
            Case Else
                Call ProcError(Err.Number, Err.Source, Err.Description)
        End Select
        Err.Clear
        Resume Next
    End Sub
    Handle Errors according to their Error numbers with a Case statement. This prevents your application from shutting down and it will give you more feedback on errors to handle them.
    A mind is like a parachute, it has to open to let it work
    www.2beesoft.com for Icon Manager with over 20.000 free icons
    VB6 Ent. SP4, ASP, W2000/W98

  6. #6
    Member
    Join Date
    Oct 2000
    Location
    Netherlands
    Posts
    54

    Not complete

    Sorry,

    Of course you don't have the procError function, but just use a msgbox instead like this:

    [code]
    gvDummy = MsgBox("Error Nr. " & Err.Number & " in " & Err.Source & Chr(13) & Err.Description & Chr(13) & Chr(13) & "Unexpected error.", vbCritical, "Error")
    [\code]

    A mind is like a parachute, it has to open to let it work
    www.2beesoft.com for Icon Manager with over 20.000 free icons
    VB6 Ent. SP4, ASP, W2000/W98

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Ireland
    Posts
    224

    Cool

    Thanks a lot for the feedback. It was really helpful.
    Cheers
    JK

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