Relative Path for Data Connection - InfoPath Dev
in

InfoPath Dev

Relative Path for Data Connection

Last post 03-29-2011 12:41 PM by ashoke. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 03-28-2011 11:41 AM

    • ashoke
    • Not Ranked
      Male
    • Joined on 02-24-2011
    • Toronto, Canada
    • Posts 21

    Relative Path for Data Connection

    Hi Everyone,

    My form is connected to an Access db. I found in the mainfest.xsf file (in source files) that the connection is hard coded. It means, it has used a full path including drive letter of the database file e.g. H:\CORR\form\temp1\db.accdb. (I think, I can get rid of drive letter issue by using server path - nto sure though). My form and database are in same folder. I’m trying to edit the .xsf file by replacing the hard coded file path to .\db.accdb to make it relative path. It means, if I move entire folder to a new location it would work. But my relative path expression is not working.

    Any suggestion would be highly appreciated.

    Thanks,

    Ash

  • 03-29-2011 11:15 AM In reply to

    Re: Relative Path for Data Connection

    I'm not sure what the relative path would be for this, or if this would work -- but I question the design decision. Do you really want a copy of the Access DB with the form? Then every user has their own DB?

    Wouldn't you want the DB on a network location instead?

    Hilary Stoupa

  • 03-29-2011 11:39 AM In reply to

    • ashoke
    • Not Ranked
      Male
    • Joined on 02-24-2011
    • Toronto, Canada
    • Posts 21

    Re: Relative Path for Data Connection

    Hi Hilary,

    Thanks for your quick reply. Let me give you more details of the situation.

    I have an Access 2007 db in a network location accessible by the users. Say for example, both the InfoPath 2007 form and Access db are located in a folder called "temp" and the path is like "G:\CORR\form\temp". I found the complete path in manifest.xsf file and can replace it with something else with complete path when I move the database. This is an absolute path. If I move the db file, form template or entire folder, it doesn't work.

    I want to connect to the db in a way so that if I move the entire folder the connection will remain functional.

    More specifically, what would be the replacement code of “Data Source=G:\CORR\form\temp\ db.accdb” in the .xsf file for a path that would find the db in the same folder? I want to make the absolute path to relative path.

    Thanks,

    Ash

  • 03-29-2011 11:55 AM In reply to

    Re: Relative Path for Data Connection

    I do understand the difference between a relative and absolute path -- but as I said in my response, I don't know what the syntax would be for a relative path to a DB in InfoPath...

    The template uses relative paths to its resource files.... I wonder if you could add your DB as a resource file? Instead of having it in your folder with the template? Then just use "Data Source=db.accdb"?

    Hilary Stoupa

  • 03-29-2011 12:41 PM In reply to

    • ashoke
    • Not Ranked
      Male
    • Joined on 02-24-2011
    • Toronto, Canada
    • Posts 21

    Re: Relative Path for Data Connection

    Thanks a million - Hilary. It seems it's working now. I might have to tweak a bit. In fact, I tried with "Data Source=db.accdb" alone. Now I have added the source file and apparently, it's working. Let me see more in it.  Thanks again for the valuable suggestions. Much appreciated. Ash

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.