Adding password to data connection

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

  1. #1

    Default Adding password to data connection

    Hi can anyone tell me how to add a password to using this connection string
    pls

    <%
    set conn = server.createobject ("ADODB.connection")
    conn.Provider="Microsoft.Jet.OLEDB.4.0"
    conn.Open(Server.Mappath("dat48372.mdb"))
    set rs = Server.CreateObject("ADODB.recordset")
    SQL = "SELECT Price FROM DABRadios WHERE (ID LIKE 6)"
    rs.Open SQL, conn
    showall=true
    %>

    Many thanks in advance




    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    Version: 6.0.491 / Virus Database: 290 - Release Date: 18/06/2003


    xool Guest

  2. Similar Questions and Discussions

    1. Contribute CS3 Connection Key Password Bug
      Symptom: Some Contribute Administrators may experience the error message "Your FTP username or password is incorrect." when importing a Connection...
    2. Connection Key Password
      When a user gets e-mailed the connection key and clicks on it to install, they are asked to provide a name, e-mail ID and password. Our...
    3. DataGrid - Adding labels: and adding data to cells
      I am just getting started with flash scripting. My downfall is trying to get the dynamic output to display in flash. I tried using the list...
    4. OLE DB connection with password
      Hi Guys I know I've moaned about this recently, but all I want is a copy and paste example of the following: MyVar = OLEDB connection to an...
    5. Adding pwd to data connection string
      Hi can anyone tell me how to add a password to using this connection string pls <% set conn = server.createobject ("ADODB.connection")...
  3. #2

    Default Re: Adding password to data connection

    xool wrote:
    > Hi can anyone tell me how to add a password to using this connection
    > string pls
    >
    > <%
    > set conn = server.createobject ("ADODB.connection")
    > conn.Provider="Microsoft.Jet.OLEDB.4.0"
    > conn.Open(Server.Mappath("dat48372.mdb"))
    > set rs = Server.CreateObject("ADODB.recordset")
    > SQL = "SELECT Price FROM DABRadios WHERE (ID LIKE 6)"
    > rs.Open SQL, conn
    > showall=true
    > %>
    >
    > Many thanks in advance
    >
    [url]www.able-consulting.com/data_conn.htm[/url]



    Bob Barrows Guest

  4. #3

    Default Re: Adding password to data connection

    Thanks Bob but that link doesn't work...


    "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    news:O1q$KTtcDHA.2416@TK2MSFTNGP09.phx.gbl...
    > xool wrote:
    > > Hi can anyone tell me how to add a password to using this connection
    > > string pls
    > >
    > > <%
    > > set conn = server.createobject ("ADODB.connection")
    > > conn.Provider="Microsoft.Jet.OLEDB.4.0"
    > > conn.Open(Server.Mappath("dat48372.mdb"))
    > > set rs = Server.CreateObject("ADODB.recordset")
    > > SQL = "SELECT Price FROM DABRadios WHERE (ID LIKE 6)"
    > > rs.Open SQL, conn
    > > showall=true
    > > %>
    > >
    > > Many thanks in advance
    > >
    > [url]www.able-consulting.com/data_conn.htm[/url]
    >
    >
    >

    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    Version: 6.0.491 / Virus Database: 290 - Release Date: 18/06/2003


    xool Guest

  5. #4

    Default Re: Adding password to data connection

    xool wrote:
    > Thanks Bob but that link doesn't work...
    >
    Aargh! That's because the link should have been this:
    [url]http://www.able-consulting.com/ADO_Conn.htm[/url]

    Sorry


    Bob Barrows Guest

  6. #5

    Default Re: Adding password to data connection

    Sorry, but you're going to have to modify what you've got. You need to put
    the database argument into the connection string as shown in the example.
    Here is the appropriate example from that page:

    If MDB has a database password
    oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=c:\somepath\mydb.mdb;" & _
    "Jet OLEDB:Database Password=MyDbPassword", _
    "myUsername", "myPassword"

    IIRC, the last two arguments ("myUsername", "myPassword") are not necessary.

    Just to forestall any further lengthening of this thread, here is how your
    connection should be opened:
    dim sDB
    sDB=Server.Mappath("dat48372.mdb")
    conn .Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=" & sDB & ";" & _
    "Jet OLEDB:Database Password=MyDbPassword"


    xool wrote:
    > Cheers Bob but I can't find a connection string that matches the
    > syntax of mine, I just need to know how to append a password to my
    > current syntax if poss...
    >
    > <%
    > set conn = server.createobject ("ADODB.connection")
    > conn.Provider="Microsoft.Jet.OLEDB.4.0"
    > conn.Open(Server.Mappath("dat48372.mdb"))
    > set rs = Server.CreateObject("ADODB.recordset")
    > SQL = "SELECT Price FROM DABRadios WHERE (ID LIKE 6)"
    > rs.Open SQL, conn
    > %>
    >
    > Cheers
    >
    >
    > "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    > news:OcnPkjtcDHA.1748@TK2MSFTNGP12.phx.gbl...
    >> xool wrote:
    >>> Thanks Bob but that link doesn't work...
    >>>
    >> Aargh! That's because the link should have been this:
    >> [url]http://www.able-consulting.com/ADO_Conn.htm[/url]
    >>
    >> Sorry
    >>
    >>
    >
    >
    > ---
    > Outgoing mail is certified Virus Free.
    > Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    > Version: 6.0.491 / Virus Database: 290 - Release Date: 18/06/2003

    Bob Barrows Guest

  7. #6

    Default Re: Adding password to data connection

    Cheers Bob, got it

    "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    news:eHW3eZucDHA.2432@TK2MSFTNGP10.phx.gbl...
    > Sorry, but you're going to have to modify what you've got. You need to put
    > the database argument into the connection string as shown in the example.
    > Here is the appropriate example from that page:
    >
    > If MDB has a database password
    > oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    > "Data Source=c:\somepath\mydb.mdb;" & _
    > "Jet OLEDB:Database Password=MyDbPassword", _
    > "myUsername", "myPassword"
    >
    > IIRC, the last two arguments ("myUsername", "myPassword") are not
    necessary.
    >
    > Just to forestall any further lengthening of this thread, here is how your
    > connection should be opened:
    > dim sDB
    > sDB=Server.Mappath("dat48372.mdb")
    > conn .Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    > "Data Source=" & sDB & ";" & _
    > "Jet OLEDB:Database Password=MyDbPassword"
    >
    >
    > xool wrote:
    > > Cheers Bob but I can't find a connection string that matches the
    > > syntax of mine, I just need to know how to append a password to my
    > > current syntax if poss...
    > >
    > > <%
    > > set conn = server.createobject ("ADODB.connection")
    > > conn.Provider="Microsoft.Jet.OLEDB.4.0"
    > > conn.Open(Server.Mappath("dat48372.mdb"))
    > > set rs = Server.CreateObject("ADODB.recordset")
    > > SQL = "SELECT Price FROM DABRadios WHERE (ID LIKE 6)"
    > > rs.Open SQL, conn
    > > %>
    > >
    > > Cheers
    > >
    > >
    > > "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    > > news:OcnPkjtcDHA.1748@TK2MSFTNGP12.phx.gbl...
    > >> xool wrote:
    > >>> Thanks Bob but that link doesn't work...
    > >>>
    > >> Aargh! That's because the link should have been this:
    > >> [url]http://www.able-consulting.com/ADO_Conn.htm[/url]
    > >>
    > >> Sorry
    > >>
    > >>
    > >
    > >
    > > ---
    > > Outgoing mail is certified Virus Free.
    > > Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    > > Version: 6.0.491 / Virus Database: 290 - Release Date: 18/06/2003
    >
    >

    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    Version: 6.0.491 / Virus Database: 290 - Release Date: 18/06/2003


    xool Guest

  8. #7

    Default OLEDB v ODBC

    Sorry if this is a thick question:

    I was having problems with db connections using ASP/VBScript/IIS.
    I had been using ODBC connections and then switched to OLEDB instead
    following advice from people here, which seems to have sorted the problem.

    My question is, basically what's the difference between OLEDB and ODBC,
    and why would connections using ODBC stop working in IIS on Win2K or WinXP??

    Thanks
    --
    ---
    | JIM | PKP |

    Jim PKP Guest

  9. #8

    Default Re: OLEDB v ODBC

    Jim PKP wrote:
    > Sorry if this is a thick question:
    >
    > I was having problems with db connections using ASP/VBScript/IIS.
    > I had been using ODBC connections and then switched to OLEDB instead
    > following advice from people here, which seems to have sorted the
    > problem.
    >
    > My question is, basically what's the difference between OLEDB and
    > ODBC,
    ODBC is the older, now obsolete, database connectivity software, that was in
    use before ADO was invented. While it did work, there were issues with it
    that MS did not want to deal with anymore, so when they developed ADO, they
    took another direction: all connectivity would be supplied via OLE DB
    providers, which could be created by anyone who wanted to write one. They
    supplied "native" providers for several database engines, including Jet and
    SQL Server. These providers talk "directly" to the database engines (well,
    no really, but close enough unless one really wants to peek under the hood).
    They also provided a provider for ODBC, called MSDASQL, which is used to
    talk to ODBC drivers. When using ODBC with ADO, you are essentially passing
    through an extra layer of software to get to your database. This leads to
    inefficiency in itself, in addition to losing functionality that may be
    incorporated into the native OLE DB provider but not into the obsolete ODBC
    driver.
    > and why would connections using ODBC stop working in IIS on Win2K or
    > WinXP??
    I don't know - I've never seen this happen.

    Bob Barrows


    Bob Barrows Guest

  10. #9

    Default Re: Adding password to data connection

    I've been lazy and made a file named ... New Text Document.udl (he he he)
    open the udl file select the datasource type, connection, type
    username/password etc.. then once im done hit the test connection botton...
    wow it said it works, open the file in notepad and copy the connection
    string into the conn.Open statement.

    You can also use the udl file as the connection as well.. i dont remember
    how, because i just assume it was slower and not necessary..

    "xool" <misc@me.net> wrote in message
    news:OOqJ5YtcDHA.2932@tk2msftngp13.phx.gbl...
    > Thanks Bob but that link doesn't work...
    >
    >
    > "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    > news:O1q$KTtcDHA.2416@TK2MSFTNGP09.phx.gbl...
    > > xool wrote:
    > > > Hi can anyone tell me how to add a password to using this connection
    > > > string pls
    > > >
    > > > <%
    > > > set conn = server.createobject ("ADODB.connection")
    > > > conn.Provider="Microsoft.Jet.OLEDB.4.0"
    > > > conn.Open(Server.Mappath("dat48372.mdb"))
    > > > set rs = Server.CreateObject("ADODB.recordset")
    > > > SQL = "SELECT Price FROM DABRadios WHERE (ID LIKE 6)"
    > > > rs.Open SQL, conn
    > > > showall=true
    > > > %>
    > > >
    > > > Many thanks in advance
    > > >
    > > [url]www.able-consulting.com/data_conn.htm[/url]
    > >
    > >
    > >
    >
    >
    > ---
    > Outgoing mail is certified Virus Free.
    > Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    > Version: 6.0.491 / Virus Database: 290 - Release Date: 18/06/2003
    >
    >

    Troy Stark 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