Author Topic: Determining the DAO version  (Read 1850 times)

0 Members and 1 Guest are viewing this topic.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Determining the DAO version
« on: January 14, 2008, 12:31:13 PM »
Yep, you heard me right, DAO, not ADO. I'll defend the use of it another time.

In the mean time, can you think of a better way to determine the active DAO version?

Code: [Select]
(defun _GetDAOVersion ( / result )

    (vl-some
   
       '(lambda ( version )
            (setq result
                (if
                    (vl-registry-read
                        (strcat
                            "HKEY_CLASSES_ROOT\\DAO.DBEngine"
                            version
                        )                     
                    )
                    (substr version 2)
                )               
            )
        )
   
       '( [color=green];| ".40" ".39" ".38" ".37" |;[/color] ".36" ".35" "")
   
    )
   
[color=green]    ;;  The result will be a string like "36" or "" (for
    ;;  DAO 3.0 which didn't specify a version number) or
    ;;  nil if DAO is not installed.[/color]
   
    result
   
)

Thanks.

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Determining the DAO version
« Reply #1 on: January 14, 2008, 04:05:20 PM »
Quote from: Michael
.. I'll defend the use of it another time.


whatever fires your engines Michael :-)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

JohnK

  • Administrator
  • Seagull
  • Posts: 10669
Re: Determining the DAO version
« Reply #2 on: January 15, 2008, 03:12:31 PM »
*phew* And people say im obscure in my references; *lol* It took me 15 minutes to find out what `DOA' was -- and im not all that sure i understand it at the moment either - .

[ http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarvb4/html/msdn_mpdao310.asp ]

I'll read and follow the links to learn as much as i can as to "what" your/you can look for and see if i cant think up a better way then the reg.

later
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10669
Re: Determining the DAO version
« Reply #3 on: January 15, 2008, 03:23:59 PM »
This guy [ http://www.delphi3000.com/articles/article_2970.asp?SK= ] Just looks in the common folder for the latest dll.

Would that be better?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Determining the DAO version
« Reply #4 on: January 15, 2008, 03:35:10 PM »
I had considered that earlier but my thinking was that mere file residency does not necessarily guarantee it's active; i.e. a dll may be resident but not necessarily registered. Good thinking tho John.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

JohnK

  • Administrator
  • Seagull
  • Posts: 10669
Re: Determining the DAO version
« Reply #5 on: January 15, 2008, 04:18:47 PM »
Then reading the reg is by far the best method.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org