DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Password on Access DB

  1. #1
    MArb Guest

    Password on Access DB


    Hi..
    I have a problem in here..
    How can i Acces a database with a password (wich i already know) from Asp
    with a DSN-less Conection to the dataB?
    Thanks for any help!!

  2. #2
    Ajit Pal Guest

    Re: Password on Access DB


    hi Marb:
    if u are trying to connect to an access db which has a pass, without creating
    a DSN, then try this code. It may help..!!

    set cn = server.CreateObject("ADODB.Connection")
    set rs = server.CreateObject("ADODB.Recordset")

    cn.Open "DRIVER=Microsoft Access Drive (*.mdb);UID=admin;PWD=your pass;DBQ=X:\complete
    path with filename of your mdb"

    set rs = cn.Execute("select * from your db")
    if (rs.EOF and rs.BOF) then
    Response.Write "No Record Found "
    Response.End
    end if





    "MArb" <ticamar@altavista.com> wrote:
    >
    > Hi..
    >I have a problem in here..
    >How can i Acces a database with a password (wich i already know) from Asp
    >with a DSN-less Conection to the dataB?
    > Thanks for any help!!



  3. #3
    Murray Foxcroft Guest

    Re: Password on Access DB

    Same way as you do in VB -
    I find it easiest to open VB, plonk down an ADO Control,
    then use it to generate the connection string, taking that connection
    string and pasting it into my ASP.




    "MArb" <ticamar@altavista.com> wrote in message
    news:3972267b$1@news.devx.com...
    >
    > Hi..
    > I have a problem in here..
    > How can i Acces a database with a password (wich i already know) from Asp
    > with a DSN-less Conection to the dataB?
    > Thanks for any help!!




  4. #4
    Frixos Kimonis Guest

    Re: Password on Access DB

    I had problems too, trying to open an Access 97 database with a password.
    In the end I discovered I had to use 'Jet OLEDBatabase Password=' instead
    of 'pwd' or 'pass' etc
    This works for me :

    Set objConn = Server.CreateObject("ADODB.Connection")
    Set objRS = Server.CreateObject("ADODB.Recordset")

    strConnection="provider=Microsoft.Jet.OLEDB.4.0;Data
    Source=\\ServerName\DB.mdb;" & _
    "Jet OLEDBatabase Password=mypassword;"

    '--our query string
    strSQL = cstr("SELECT * " & _
    "FROM " & _
    "Actions")

    ' -- Open the Connection
    objConn.Open strConnection

    set objRS = objConn.Execute (strSQL)

    "MArb" <ticamar@altavista.com> wrote in message
    news:3972267b$1@news.devx.com...
    >
    > Hi..
    > I have a problem in here..
    > How can i Acces a database with a password (wich i already know) from Asp
    > with a DSN-less Conection to the dataB?
    > Thanks for any help!!




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center