Using Microsoft Access and Enterprise Library 2.0

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dhussong

    #1

    Using Microsoft Access and Enterprise Library 2.0

    I am attempting to use Visual Studio 2005 (Visual Basic) and the Enterprise
    Library 2.0 Data Access Application Block with a Microsoft Access database. I
    know the names of my Access databases but I don't know their location until
    the user has started using the application. Therefore I cannot hardcode the
    location into the app.config file as the Data Access Application Block seems
    to need. So I have 2 questions:
    1. Is it possible to use a relative path in the app.config file that will be
    automatically replaced? For example, could I put in [AppDataPath] in the
    app.config file as a placeholder and then replace it at runtime with
    "C:\Documen ts and Settings\userna me\Application Data"?

    2. If 1 above is not possible, is it possible to change the connection
    string that is used by the DatabaseFactory .CreateDatabase () method so that I
    can point it to my Access database?

    Thanks in advance.
  • Delphi

    #2
    RE: Using Microsoft Access and Enterprise Library 2.0

    Hi dhussong
    I worked with Enterprise Library Block 2003 v:1.1.0.
    Here what i will do is read the dataconfigurati on.xml from my application
    and change the connection string and it is working. If you got any other
    option pls let me know..

    Michael George



    "dhussong" wrote:
    [color=blue]
    > I am attempting to use Visual Studio 2005 (Visual Basic) and the Enterprise
    > Library 2.0 Data Access Application Block with a Microsoft Access database. I
    > know the names of my Access databases but I don't know their location until
    > the user has started using the application. Therefore I cannot hardcode the
    > location into the app.config file as the Data Access Application Block seems
    > to need. So I have 2 questions:
    > 1. Is it possible to use a relative path in the app.config file that will be
    > automatically replaced? For example, could I put in [AppDataPath] in the
    > app.config file as a placeholder and then replace it at runtime with
    > "C:\Documen ts and Settings\userna me\Application Data"?
    >
    > 2. If 1 above is not possible, is it possible to change the connection
    > string that is used by the DatabaseFactory .CreateDatabase () method so that I
    > can point it to my Access database?
    >
    > Thanks in advance.[/color]

    Comment

    Working...