Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

FollowHyperlink Method

Discussion in 'Information Technology' started by Janelle.Dunlap@ge.com, Jul 28, 2006.

  1. Janelle.Dunlap@ge.com

    Janelle.Dunlap@ge.com
    Expand Collapse
    Guest

    I have used the CreateDatabase method in vb to create a new access
    database. I now need to open this new database and close the existing
    one. The code I am using to do this is as follows:

    Application.FollowHyperlink strSaveFileName
    Application.Quit

    Where strSaveFileName is the string file path to the newly created
    database. When I run this I am getting an error: Cannot Open Specified
    File. This doesn't make sense to me because I can open the new
    database manually and have also tried adding a hyperlink on my form
    that points directly to the new database - and this works fine. Any
    suggestions?
     
  2. Loading...

    Similar Threads Forum Date
    Sikhi Guru Nanak's Methodology Of Finding Truth Sikh Sikhi Sikhism Jan 1, 2016
    Spiritual Daily Amrit Vela Blog - Difficulties, Joys, Methods Of This Practical Journey To Self Discovery Blogs Oct 21, 2015
    The Ten Methods of meditating on the world that can lead to happiness and fulfillment Interfaith Dialogues Dec 15, 2012
    Hukam Vs. "Tarot" Methods Questions and Answers Sep 23, 2012
    Poetry Single method is enough...loll Punjab, Punjabi, Punjabiyat Nov 8, 2011

  3. Dirk Goldgar

    Dirk Goldgar
    Expand Collapse
    Guest

    <Janelle.Dunlap@ge.com> wrote in message
    news:1150991037.221112.93900@b68g2000cwa.googlegroups.com
    > I have used the CreateDatabase method in vb to create a new access
    > database. I now need to open this new database and close the existing
    > one. The code I am using to do this is as follows:
    >
    > Application.FollowHyperlink strSaveFileName
    > Application.Quit
    >
    > Where strSaveFileName is the string file path to the newly created
    > database. When I run this I am getting an error: Cannot Open
    > Specified File. This doesn't make sense to me because I can open the
    > new database manually and have also tried adding a hyperlink on my
    > form that points directly to the new database - and this works fine.
    > Any suggestions?


    What exactly is in strSaveFileName? Does it include the full path to
    the file?

    --
    Dirk Goldgar, MS Access MVP
    www.datagnostics.com

    (please reply to the newsgroup)
     
  4. Janelle.Dunlap@ge.com

    Janelle.Dunlap@ge.com
    Expand Collapse
    Guest

    Dirk Goldgar wrote:
    > What exactly is in strSaveFileName? Does it include the full path to
    > the file?
    >
    > --
    > Dirk Goldgar, MS Access MVP
    > www.datagnostics.com
    >
    > (please reply to the newsgroup


    Yes, it returns the full file path to the new database. I'm sure it is
    returning the right path because I have referenced it in other
    situations and it is running correctly.
     
  5. Dirk Goldgar

    Dirk Goldgar
    Expand Collapse
    Guest

    <Janelle.Dunlap@ge.com> wrote in message
    news:1151000978.131512.209600@y41g2000cwy.googlegroups.com
    >
    > Yes, it returns the full file path to the new database. I'm sure it
    > is returning the right path because I have referenced it in other
    > situations and it is running correctly.


    This code works fine for me:

    Dim strSaveFileName As String

    strSaveFileName = "C:\Temp\MyNewDB.mdb"

    DBEngine.CreateDatabase strSaveFileName, dbLangGeneral

    Application.FollowHyperlink strSaveFileName
    Application.Quit

    If it doesn't work for you, maybe the "mdb" filetype isn't associated
    with Microsoft Access on your system, though I'd think it would be. Or
    maybe you still have that database opened exclusively in your code -- is
    that possible?

    --
    Dirk Goldgar, MS Access MVP
    www.datagnostics.com

    (please reply to the newsgroup)
     
  6. Janelle.Dunlap@ge.com

    Janelle.Dunlap@ge.com
    Expand Collapse
    Guest

    I figured it out. I just needed to define the Default Ext as mdb.
    Thanks for your help!
     

Share This Page