Results 1 to 2 of 2

Thread: Error handling in Active X Data dlls

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2000
    Posts
    25
    Hi

    I want to use some classes in an Active X Dll that would represent tables in an Acess database

    This dll would then be accessed from my app meaning that that the data would be seperated from the front end

    What I am not sure about though is how to handle errors

    If I placed addnew, edit or update methods in the class would they have to be made functions returning a boolean value rather than normal sub methods

    the code from the front end would then be

    set ObjSales = new SalesDll.clsSales

    if objsales.addnew then
    ' add new items

    if objsales.update then
    msgbox "all ok "
    else
    msgbox "Errors occured"
    end if

    Therefore what I need to know is how to communcicate errors betweeen the dll and the calling form

    many thanks

    Mark

















  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    You have to raise errors in the dll that are then handled by the calling application. You can either raise the errors that are generated from the operation (such as an unsuccessful AddNew) or generate your own error codes.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    monte96_@hotmail.com
    monte96@vbgarage.com


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

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