Help with OLEDB connection string

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Help with OLEDB connection string

    Hi,

    I'm following the below example in order to create a connection to my Access
    database. My question is, is it possible to include the username and
    password as part of the connection string? I've tried appending
    "UID=username;PWD=passsord" to the cst connection string, but I get a "Not a
    Valid Account Name or Password" error.

    Please don't shoot me down in flames, but the reason I'm trying to do this
    is so that I can continue to use Dreamweaver in order to create my asp pages
    (I know it code bloats, but I'm not doing anything fancy!). DW has the
    ability of accepting a custom connection string and I'm trying to use this
    rather than a DSN based one (at least I've learnt something from you guys
    here!!!)

    Help appreciated.

    <%
    cst = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
    Server.MapPath("/<pathtofile.mdb>") & ";" & _
    "Jet OLEDB:System Database=<wg_file_name>.mdw"
    set conn = CreateObject("ADODB.Connection")
    conn.open cst, "Username", "Password"
    %>


    Matt Guest

  2. Similar Questions and Discussions

    1. Dreamweaver ASP.NET OLEDB connection problem
      have some Dreamweaver ASP .NET OLE DB connectin problem - I have "The connection was made susessfull" message but doesn't see any table in it. Can...
    2. Replacement for OLEDB connection in MX?
      My ISP used to have Cold Fusion 5 running on their servers, allowing me to connect to databases via OLEDB connection: <CFSET...
    3. OLEDB connection string help
      I'm trying to connect to a SQL Server using dsn-less connection string such as "PROVIDER=SQLOLEDB;DATA...
    4. OLEDB COnnection String to Oracle
      Does someone know the proper connection string for using OLE DB connection to an oracle server ? Jon Spartan
    5. Connection string - ODBC vs OLEDB and Unspecified Error
      This one has me stumped and I was wondering if anyone might have a solution... Using this connection string ...
  3. #2

    Default Re: Help with OLEDB connection string

    Are you actually using a password-protected workgroup file? If not, you
    should just have:

    <%
    cst = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
    Server.MapPath("/path_to_file.mdb")
    set conn = CreateObject("ADODB.Connection")
    conn.open cst
    %>





    "Matt" <mystery@BarrysworldNoLongerWorks.com> wrote in message
    news:OpEPyUvzDHA.3656@TK2MSFTNGP11.phx.gbl...
    > Hi,
    >
    > I'm following the below example in order to create a connection to my
    Access
    > database. My question is, is it possible to include the username and
    > password as part of the connection string? I've tried appending
    > "UID=username;PWD=passsord" to the cst connection string, but I get a "Not
    a
    > Valid Account Name or Password" error.
    >
    > Please don't shoot me down in flames, but the reason I'm trying to do this
    > is so that I can continue to use Dreamweaver in order to create my asp
    pages
    > (I know it code bloats, but I'm not doing anything fancy!). DW has the
    > ability of accepting a custom connection string and I'm trying to use this
    > rather than a DSN based one (at least I've learnt something from you guys
    > here!!!)
    >
    > Help appreciated.
    >
    > <%
    > cst = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
    > Server.MapPath("/<pathtofile.mdb>") & ";" & _
    > "Jet OLEDB:System Database=<wg_file_name>.mdw"
    > set conn = CreateObject("ADODB.Connection")
    > conn.open cst, "Username", "Password"
    > %>
    >
    >

    Foo Man Chew Guest

  4. #3

    Default Re: Help with OLEDB connection string

    Yes - I am using a workgroup file as I provide different levels of access to
    different groups of users.

    "Foo Man Chew" <foo@man.chew> wrote in message
    news:eXvq1XvzDHA.3900@tk2msftngp13.phx.gbl...
    > Are you actually using a password-protected workgroup file? If not, you
    > should just have:
    >
    > <%
    > cst = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
    > Server.MapPath("/path_to_file.mdb")
    > set conn = CreateObject("ADODB.Connection")
    > conn.open cst
    > %>
    >
    >
    >
    >
    >
    > "Matt" <mystery@BarrysworldNoLongerWorks.com> wrote in message
    > news:OpEPyUvzDHA.3656@TK2MSFTNGP11.phx.gbl...
    > > Hi,
    > >
    > > I'm following the below example in order to create a connection to my
    > Access
    > > database. My question is, is it possible to include the username and
    > > password as part of the connection string? I've tried appending
    > > "UID=username;PWD=passsord" to the cst connection string, but I get a
    "Not
    > a
    > > Valid Account Name or Password" error.
    > >
    > > Please don't shoot me down in flames, but the reason I'm trying to do
    this
    > > is so that I can continue to use Dreamweaver in order to create my asp
    > pages
    > > (I know it code bloats, but I'm not doing anything fancy!). DW has the
    > > ability of accepting a custom connection string and I'm trying to use
    this
    > > rather than a DSN based one (at least I've learnt something from you
    guys
    > > here!!!)
    > >
    > > Help appreciated.
    > >
    > > <%
    > > cst = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
    > > Server.MapPath("/<pathtofile.mdb>") & ";" & _
    > > "Jet OLEDB:System Database=<wg_file_name>.mdw"
    > > set conn = CreateObject("ADODB.Connection")
    > > conn.open cst, "Username", "Password"
    > > %>
    > >
    > >
    >
    >

    Matt Guest

  5. #4

    Default Re: Help with OLEDB connection string

    According to [url]www.able-consulting.com/ado_conn.htm[/url], this is the correct
    syntax for a workgroup-protected database:

    oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=c:\somepath\mydb.mdb;" & _
    "Jet OLEDB:System Database=MySystem.mdw", _
    "myUsername", "myPassword"

    HTH,
    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup

    Matt wrote:
    > Yes - I am using a workgroup file as I provide different levels of
    > access to different groups of users.
    >
    > "Foo Man Chew" <foo@man.chew> wrote in message
    > news:eXvq1XvzDHA.3900@tk2msftngp13.phx.gbl...
    >> Are you actually using a password-protected workgroup file? If not,
    >> you should just have:
    >>
    >> <%
    >> cst = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
    >> Server.MapPath("/path_to_file.mdb")
    >> set conn = CreateObject("ADODB.Connection")
    >> conn.open cst

    Bob Barrows Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139