trying to us RELATIVE PATH ON MY CONNECTION STRIN

Discussion in 'ASP .Net' started by RAW, Nov 15, 2003.

  1. RAW

    RAW Guest

    Hi Im trying to us relative path in my connection string instead of absolute
    what Im doing wrong this is my code

    Sub Page_Load() Dim strConnection as String =
    "Provider=Microsoft.Jet.OLEDB.4.0;" strConnection += "Data
    Source=Server.MapPath("../dbcontainer/content.mdb") data_src.text =
    strConnection
     
    RAW, Nov 15, 2003
    #1
    1. Advertisements

  2. RAW

    Alvin Bruney Guest

    What is the exception and what does server.mapppath return?

    This by the way is not a good idea to build a connection string because you
    will not be taking adantage of the connection pooling in the framework.
    Connection pooling uses a exact match algorithm. Most times, building
    strings does not result in a exact match.

    regards

    --


    -----------
    Got TidBits?
    Get it here: www.networkip.net/tidbits
    "RAW" <> wrote in message
    news:...
    > Hi Im trying to us relative path in my connection string instead of

    absolute
    > what Im doing wrong this is my code
    >
    > Sub Page_Load() Dim strConnection as String =
    > "Provider=Microsoft.Jet.OLEDB.4.0;" strConnection += "Data
    > Source=Server.MapPath("../dbcontainer/content.mdb") data_src.text =
    > strConnection
    >
    >
     
    Alvin Bruney, Nov 15, 2003
    #2
    1. Advertisements

  3. RAW

    RAW Guest

    simple questions
    with a simple answers

    relative connection
    Dim strConnection as String = "Provider=Microsoft.Jet.OLEDB.4.0; Data
    Source="& _ 'Server.MapPath("../NEWMGS/dbcontainer/content.mdb")

    Absolute connection
    Dim strConnection as String = "Provider=Microsoft.Jet.OLEDB.4.0; Data
    Source=D:\works\WEBS\NEWMGS\dbcontainer\content.mdb" DIM setNiveles AS
    INTEGER DIM setContenido AS STRING DIM setPagina AS STRING

    "Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com> wrote in
    message news:...
    > What is the exception and what does server.mapppath return?
    >
    > This by the way is not a good idea to build a connection string because

    you
    > will not be taking adantage of the connection pooling in the framework.
    > Connection pooling uses a exact match algorithm. Most times, building
    > strings does not result in a exact match.
    >
    > regards
    >
    > --
    >
    >
    > -----------
    > Got TidBits?
    > Get it here: www.networkip.net/tidbits
    > "RAW" <> wrote in message
    > news:...
    > > Hi Im trying to us relative path in my connection string instead of

    > absolute
    > > what Im doing wrong this is my code
    > >
    > > Sub Page_Load() Dim strConnection as String =
    > > "Provider=Microsoft.Jet.OLEDB.4.0;" strConnection += "Data
    > > Source=Server.MapPath("../dbcontainer/content.mdb") data_src.text =
    > > strConnection
    > >
    > >

    >
    >
     
    RAW, Nov 16, 2003
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Rowland

    Reg exp: matching relative path only.

    Andrew Rowland, Aug 2, 2003, in forum: Perl
    Replies:
    0
    Views:
    1,228
    Andrew Rowland
    Aug 2, 2003
  2. Matt
    Replies:
    3
    Views:
    20,737
    Sudsy
    Jul 8, 2004
  3. Marcelo Pinto
    Replies:
    4
    Views:
    589
  4. Thomas Guettler
    Replies:
    3
    Views:
    1,005
    Andrei
    Oct 27, 2003
  5. chachra
    Replies:
    1
    Views:
    1,133
    Eric Sosman
    Jan 9, 2007
  6. Oren
    Replies:
    1
    Views:
    696
    Michael D. Ober
    Apr 29, 2007
  7. Nigel Wilkinson
    Replies:
    2
    Views:
    618
    Nigel Wilkinson
    Jul 25, 2005
  8. Joel VanderWerf

    millisec in strin representation of Time

    Joel VanderWerf, Aug 27, 2005, in forum: Ruby
    Replies:
    6
    Views:
    280
    Joel VanderWerf
    Aug 29, 2005
Loading...