Autodetect of SQL DMO version

  • I have a software which was developed to use SQL6.5 DMO. I am in the process of upadting the software so that it will detect the server as either 6.5 or 7.0 and then run the appropriate DMO for the version. This is getting more difficult than I expect. The software is writen with VC++. Datatypes for 6.5 have a preifx of SQLOLE while for 7.0 it is SQLDMO.

    Has anyone done this and know the best way to go about it.

    Thanks

    eletuw

  • You can identify the version of SQL you are conencted to through the Properties collection of the Server object (start by using the latest DMO to query the server).

    Debug.Print vServer.Properties("versionmajor")
    
    Debug.Print vServer.Properties("versionminor")

    This will give you the information needed to determine what version you are running. I'm not sure if this is the answer you are looking for, please let me know. Are you running into specific compatibility issues with different versions of SQL server and DMO? I have not used DMO with 6.5 in a while, and the exposure I had at the time was limited.

    Sean

  • I havent done much with 6.5 DMO either - with luck never will! You could also just test the server version first by using ADO to execute 'select @@version', then branching into your DMO based on the result.

    Andy

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply