none
How safely install VFP OLE DB using VFPOLEDBSetup.msi?

    Question

  • My application uses ADO to access various databases, using Visual FoxPro's OLE DB provider; so I need to install this on customer's PCs, if it isn't already there.

    The installation package for VFP OLE DB is called VFPOLEDBSetup.msi.  According to the documentation for it at http://www.microsoft.com/download/en/details.aspx?id=14839, it will replace whatever version of Visual FoxPro OLE DB is already on the PC that it is installed on.  Presumably that's not a problem if the user had a version that is earlier than 9.0?  What if they have a later version?  I want to install Visual FoxPro OLE DB in a responsible and safe way - i.e. with no risk of breaking any existing applications on their PC.  How do I do this?  Is there any way of setting parameters for VFPOLEDBSetup.msi to prevent it installing if there is already a later version of VFP OLE DB on the PC?

    My installation program must look professional.  I want the whole issue to be handled smoothly and automatically, without the user having to answer any questions that they probably wouldn't understand anyway.

    Thanks in advance.

    Simon

     




    Simon
    Thursday, July 07, 2011 4:33 PM

Answers

  • VFP OLE DB provider is used to query data. Same way you may query its version:

    SELECT VERSION() AS OLEDBVers FROM SomeTable

    The table "SomeTable" must exist, of course, but you could evaluate just an expression:

    EVALUATE("VERSION()")

    which will return scalar value.

    Monday, July 11, 2011 3:17 PM
    Moderator
  • The safest way is to detect what is installed on client computer, and if  VFP OLE DB is missing send client to microsoft web site to install it and after that install your application.
    dni
    Monday, July 11, 2011 4:59 PM

All replies

  • As the page states "This version of the VFP OLE DB provider is the same version as the one included with Visual FoxPro 9.0 SP2." then I am sure it is the latest version from Microsoft.

    So, the only concern could be whether applications installed on customer's PC use some specific features which are just in some older version of VFP OLE DB provider.

    The information about the OLE DB provider is in Windows Registry or you may try to establish a connection to it during installation process and decide about further steps.

    Thursday, July 07, 2011 7:06 PM
    Moderator
  • I do believe that the version I am proposing to install is the latest version.  But my app could be around for a long time, and there is no way that I can recall all copies of it if a new version of Visual FoxPro is released.  So unless you are hinting that there aren't going to be any more versions of Visual FoxPro, I can't see that older versions are "the only concern". [EDIT: I had checked the Wikipedia entry for Visual FoxPro before I wrote this, but I've just re-checked it and found this "In March 2007, Microsoft announced that there will be no VFP 10".  Don't know how I missed that first time.  Sorry!]

    >> The information about the OLE DB provider is in Windows Registry

    Yes.  I found a MS web page which says

    >>
    When you install the Visual FoxPro OLE DB Provider, the installation program updates your system registry, HKEY CLASSES_ROOT, and adds the following new keys:

    HKEY_CLASSES_ROOT\VFPOLEDB
    HKEY_CLASSES_ROOT\VFPOLEDB.1
    HKEY_CLASSES_ROOT\Vfpoledb.ConnectionPage
    HKEY_CLASSES_ROOT\Vfpoledb.ConnectionPage.1
    HKEY_CLASSES_ROOT\VFPOLEDB.ErrorLookup
    HKEY_CLASSES_ROOT\VFPOLEDB.ErrorLookup.1
    <<

    That's a good start.  But I couldn't find any version information in these keys.  It looks to me as though you could probably do this:

    • Get the value of the CLSID key in  HKEY_CLASSES_ROOT\VFPOLEDB as <VFP OLEDB CLSID>
    • Get the default value of HKEY_CLASSES_ROOT\CLSID\<VFP OLEDB CLSID>\InprocServer32 - which is a path to vfpoledb.dll
    • Use Win32 APIs to get the version number from vfpoledb.dll.

    Is that what you're supposed to do?  Isn't there a better/easier way?  What if vfpoledb.dll is loaded in memory at the time?  Will I still be able to get the version number from the file?

    >> or you may try to establish a connection to it during installation

    Can you give more details about how this might work.  How could I get the version information this way?

    >> So, the only concern could be whether applications installed on customer's PC use some specific features which are just in some older version of VFP OLE DB provider.

    Is that possible?  Are new versions of VFP OLE DB provider not necessarily backwardly compatible with old versions?

    All help much appreciated.
    Simon
    • Edited by simon22 Friday, July 08, 2011 9:03 AM Added EDIT note.
    Friday, July 08, 2011 8:27 AM
  • Since I wrote the above, I have just discovered that Microsoft announced that there will no VFP 10, in 2007 (see my edit in previous post).  SO...  the problem is less serious than I thought.  It does appear that it's only old versions that I've got to worry about.  But my last question is still valid: Are new versions of VFP OLE DB provider not necessarily backwardly compatible with old versions?

    Thanks


    Simon
    Friday, July 08, 2011 9:05 AM
  • In my opinion, I think it is Yes.

     


    Call me ghost for short, Thanks
    To get the better anwser, it should be a better question.
    Monday, July 11, 2011 11:32 AM
  • VFP OLE DB provider is used to query data. Same way you may query its version:

    SELECT VERSION() AS OLEDBVers FROM SomeTable

    The table "SomeTable" must exist, of course, but you could evaluate just an expression:

    EVALUATE("VERSION()")

    which will return scalar value.

    Monday, July 11, 2011 3:17 PM
    Moderator
  • The safest way is to detect what is installed on client computer, and if  VFP OLE DB is missing send client to microsoft web site to install it and after that install your application.
    dni
    Monday, July 11, 2011 4:59 PM