Results 1 to 2 of 2

Thread: SQL_DMO.SQLServer Problem -> Need Some Help!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2002
    Posts
    21

    Unhappy SQL_DMO.SQLServer Problem -> Need Some Help!

    I'm trying to connect to an SQL Server on a deferent machine using SQL_DMO object.
    I want to connect and then to check the connection and to get the right event for it:

    option explicit

    public withevents Dmo as SQLDMO.SQLServer
    ___________________________________________

    ...Form_load()

    Set Dmo = New SQLDMO.SQLServer

    Dmo.LoginSecure = False

    Dmo.Connect m_ServerName, m_LoginName, m_LoginPassword

    Dmo.VerifyConnection

    ************************************************************************

    If I'm declaring the Dmo like this:

    public Dmo as SQLDMO.SQLServer

    it's working fine only I don't get any events.

    If I'm declaring the Dmo like this:

    public withevents Dmo as SQLDMO.SQLServer

    After the Dmo.Connect..... It gives me an Error:


    [SQL-DMO] code execution exception:
    EXCEPTION_ACCESS_VIOLATION


    AND I JEST DON'T NOW WHAT IS THE PROBLEM HERE?!
    Last edited by RivKin; Mar 3rd, 2002 at 12:13 PM.

  2. #2
    Lively Member blaff's Avatar
    Join Date
    Nov 2002
    Location
    Germany
    Posts
    69

    SQLDMO and WithEvents

    Hi there,

    I had a similar problem, maybe the same solution applies:

    Add an event-handler for EVERY event the SQLDMO-object offers (do this for every SQLDMO-Class).

    If you don't want to do anything in the event-handler add a comment-line!

    I know it sounds strange but it worked for me!

    Kind regards,

    Blaff

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