MS-Access RecordSet

Discussion in 'ASP General' started by Al, Aug 6, 2004.

  1. Al

    Al Guest

    Can any one explain what wrong with this code?
    Same code without the userid and password works fine in the same IIS Server.

    Please do not mind the Directive #IF #ELSE #END IF
    I only use it to describe you the issue.

    #IF PasswordProcted then
    '- Works Fine
    m_MSConnString =
    "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Database.mdb;"
    #ELSE
    '- Do not Work
    m_MSConnString =
    "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Database.mdb;User
    ID=Admin;Password=123;"
    #End IF

    Set oRecordSet = Server.CreateObject ("ADODB.Recordset")
    oRecordSet.ActiveConnection = m_MSConnString
    oRecordSet.Source = "SELECT * FROM TableName"
    oRecordSet.CursorType = 0
    oRecordSet.CursorLocation = 2
    oRecordSet.LockType = 3
    oRecordSet.Open()

    BTW: User ID and Password are correct I can open the database with MS-Access
    when ask for the password insert password and open database with no problem


    TIA
    Al
    Al, Aug 6, 2004
    #1
    1. Advertising

  2. Al wrote:
    > Can any one explain what wrong with this code?
    > Same code without the userid and password works fine in the same IIS
    > Server.


    What is failing?

    > '- Do not Work


    What does that mean? Error message? We're not looking over your shoulder.
    :)

    > m_MSConnString =
    > "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Database.mdb;User
    > ID=Admin;Password=123;"


    Go to www.able-consulting.com/ado_conn.htm to see an example of the correct
    syntax for a connection string to connect to a password-protected database.

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Aug 6, 2004
    #2
    1. Advertising

  3. Al

    Al Guest

    Sorry, here it goes

    Error Message Gotten
    error '8002801d'
    Library not registered.

    /iisHelp/common/500-100.asp, line 10



    "Bob Barrows [MVP]" <> wrote in message
    news:%23$...
    > Al wrote:
    > > Can any one explain what wrong with this code?
    > > Same code without the userid and password works fine in the same IIS
    > > Server.

    >
    > What is failing?
    >
    > > '- Do not Work

    >
    > What does that mean? Error message? We're not looking over your shoulder.
    > :)
    >
    > > m_MSConnString =
    > > "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Database.mdb;User
    > > ID=Admin;Password=123;"

    >
    > Go to www.able-consulting.com/ado_conn.htm to see an example of the

    correct
    > syntax for a connection string to connect to a password-protected

    database.
    >
    > Bob Barrows
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
    >
    Al, Aug 6, 2004
    #3
  4. Al

    Al Guest

    Forgot the error message
    on my Windows XP Pro with IIS5
    error '8002801d'
    Library not registered.

    /iisHelp/common/500-100.asp, line 10

    on my Windows Host Server

    Microsoft JET Database Engine error '80040e4d'

    Cannot start your application. The workgroup information file is missing or
    opened exclusively by another user.

    Try to Open Connection to MS-Access Database

    "Al" <> wrote in message
    news:%...
    > Can any one explain what wrong with this code?
    > Same code without the userid and password works fine in the same IIS

    Server.
    >
    > Please do not mind the Directive #IF #ELSE #END IF
    > I only use it to describe you the issue.
    >
    > #IF PasswordProcted then
    > '- Works Fine
    > m_MSConnString =
    > "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Database.mdb;"
    > #ELSE
    > '- Do not Work
    > m_MSConnString =
    > "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Database.mdb;User
    > ID=Admin;Password=123;"
    > #End IF
    >
    > Set oRecordSet = Server.CreateObject ("ADODB.Recordset")
    > oRecordSet.ActiveConnection = m_MSConnString
    > oRecordSet.Source = "SELECT * FROM TableName"
    > oRecordSet.CursorType = 0
    > oRecordSet.CursorLocation = 2
    > oRecordSet.LockType = 3
    > oRecordSet.Open()
    >
    > BTW: User ID and Password are correct I can open the database with

    MS-Access
    > when ask for the password insert password and open database with no

    problem
    >
    >
    > TIA
    > Al
    >
    >
    Al, Aug 6, 2004
    #4
  5. Get the latest MDAC, JET, and Jet SP, and install those on the server in
    that order. You can find the relevant links here:
    http://www.aspfaq.com/2342

    Then, use this connection string (from
    http://www.able-consulting.com/MDAC..._Providers.htm#OLEDBProviderForMicrosoftJet):

    conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=C:\Database.mdb;" & _
    "Jet OLEDB:Database Password=123", _
    "Admin", "123"

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    "Al" <> wrote in message
    news:evs0nY#...
    > Forgot the error message
    > on my Windows XP Pro with IIS5
    > error '8002801d'
    > Library not registered.
    >
    > /iisHelp/common/500-100.asp, line 10
    >
    > on my Windows Host Server
    >
    > Microsoft JET Database Engine error '80040e4d'
    >
    > Cannot start your application. The workgroup information file is missing

    or
    > opened exclusively by another user.
    >
    > Try to Open Connection to MS-Access Database
    >
    > "Al" <> wrote in message
    > news:%...
    > > Can any one explain what wrong with this code?
    > > Same code without the userid and password works fine in the same IIS

    > Server.
    > >
    > > Please do not mind the Directive #IF #ELSE #END IF
    > > I only use it to describe you the issue.
    > >
    > > #IF PasswordProcted then
    > > '- Works Fine
    > > m_MSConnString =
    > > "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Database.mdb;"
    > > #ELSE
    > > '- Do not Work
    > > m_MSConnString =
    > > "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Database.mdb;User
    > > ID=Admin;Password=123;"
    > > #End IF
    > >
    > > Set oRecordSet = Server.CreateObject ("ADODB.Recordset")
    > > oRecordSet.ActiveConnection = m_MSConnString
    > > oRecordSet.Source = "SELECT * FROM TableName"
    > > oRecordSet.CursorType = 0
    > > oRecordSet.CursorLocation = 2
    > > oRecordSet.LockType = 3
    > > oRecordSet.Open()
    > >
    > > BTW: User ID and Password are correct I can open the database with

    > MS-Access
    > > when ask for the password insert password and open database with no

    > problem
    > >
    > >
    > > TIA
    > > Al
    > >
    > >

    >
    >
    Aaron [SQL Server MVP], Aug 6, 2004
    #5
    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. Hung Huynh
    Replies:
    8
    Views:
    298
    Bob Barrows
    Sep 24, 2003
  2. Anand
    Replies:
    1
    Views:
    194
    Bob Barrows
    Feb 6, 2004
  3. Keith
    Replies:
    2
    Views:
    218
  4. ching
    Replies:
    3
    Views:
    279
    Bob Barrows [MVP]
    Sep 22, 2005
  5. Yosi

    ASP Access Recordset Paging

    Yosi, Aug 5, 2008, in forum: ASP General
    Replies:
    6
    Views:
    220
Loading...

Share This Page