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. Advertising

  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. Advertising

  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. Advertising

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. Matt
    Replies:
    3
    Views:
    19,539
    Sudsy
    Jul 8, 2004
  2. Marcelo Pinto
    Replies:
    4
    Views:
    431
  3. Thomas Guettler
    Replies:
    3
    Views:
    754
    Andrei
    Oct 27, 2003
  4. chachra
    Replies:
    1
    Views:
    891
    Eric Sosman
    Jan 9, 2007
  5. Joel VanderWerf

    millisec in strin representation of Time

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

Share This Page