Problem getting connction to Access DB using ASP

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

  1. #1

    Default Problem getting connction to Access DB using ASP

    I have a website running on a Win2000 Machine (IIS), and it's
    programmed in ASP and uses an Access 2000 DB.

    The site generally runs fine. However I used to have a problem that
    occasionally the website could no longer get a connection to the DB. I
    had noticed that this always happened after I had downloaded the DB
    made some changes to the DB structure and uploaded it again. The ASP
    code would always fail at connection BD connection line. The only
    solution I found to resolve the problem would be to restart the
    server! I tried switching to a DSN Less connection (used to use
    ODBC... see my connection string below) but that also didn't prevent
    it from happening.

    After having given up on trying to find out how not prevent this from
    happening after uploading, I ended up figured out how to make all
    changes to the DB with SQL commands which although a bit more
    cumbersome (for me anyway!), did allow me to make the changes and have
    the added benefit of not having to take the site offline for a couple
    of mins so I could live with that.

    However... to my surprise I now have the same problem AND I have't
    made any change the the DB myself! This is very annoying (especially
    like now if it happens during the weekend and I have no service at the
    hosting provider till mon!).

    Has anyone else had this experience? What is the cause? Is there a way
    to prevent this from happening? Or at least a way to set it right
    again without having to restart the server? Since the problem appears
    NOT to be with the Database (if I download it locally it works fine),
    it would lead me to belive it has something to do with the Access
    driver. I had tried to use the OLEDB driver, but several of my queries
    did not work or gave different results to the Access Driver.

    Hoping there is an "easy" fix!

    Thanks for any help in advance,


    Quintus

    ---
    <%

    'response.Redirect("../default_temp.asp")
    'response.end

    Dim conn
    Set conn = Server.CreateObject("ADODB.Connection")
    'ConnStr = "DSN=toucanart"

    dbpath = "d:/http/toucanart.net/Databases/project21.mdb"

    'ConnStr="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="
    'ConnStr=ConnStr & dbpath & ";"

    'ConnStr=ConnStr & "Password=whatever;"


    ConnStr2="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & dbpath

    ConnStr="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & dbpath

    conn.open ConnStr

    '---- CursorTypeEnum Values ----
    Const adOpenForwardOnly = 0
    Const adOpenKeyset = 1
    Const adOpenDynamic = 2
    Const adOpenStatic = 3

    '---- LockTypeEnum Values ----
    Const adLockReadOnly = 1
    Const adLockPessimistic = 2
    Const adLockOptimistic = 3
    Const adLockBatchOptimistic = 4

    '---- CursorLocationEnum Values ----
    Const adUseServer = 2
    Const adUseClient = 3
    %>
    Quintus Snapper Guest

  2. Similar Questions and Discussions

    1. MS Access Problem
      I am trying to link my asp pages in dreamweaver into MS access - can create a registration page and login page OK, but then get into problem when...
    2. contribute problem - access denied file may not existpermission problem
      Recieving the following error message - "access denied file may not exist , or there could be a permission problem" this happened this morning ,...
    3. Access problem
      Hi, I am trying to upload something into a directory on my server but always i am getting a permission denied ONLY from this server...i have tried...
    4. Uploading problem = weird warning (was: access denied problem.....)
      Hi, I had a problem where my upload form was not working on our production server but was working on two other servers, after checking the...
    5. Conversion problem from Access 97 to Access 2002
      I have an old access 97 database and I tried to convert to Access 2002. After the conversion, some of the forms and all modules are not converted...
  3. #2

    Default Re: Problem getting connction to Access DB using ASP

    You need to tell us the error message. You should avoid using ODBC, as the
    Jet OLEDB provider will have the most features and provide the most robust
    connection. I know your experience argues against the latter, but without
    the error message, it's pretty hard for us to troubleshoot ...

    I do recall that compacting a database will sometimes cause permissions
    problems (IUSR no longer has permissions for the compacted database), so
    that's the first thing I would investigate. Instead of restarting the
    server, explicitly grant Change permissions on the newly uploaded database
    to the IUSR account.

    Bob Barrows

    Quintus Snapper wrote:
    > I have a website running on a Win2000 Machine (IIS), and it's
    > programmed in ASP and uses an Access 2000 DB.
    >
    > The site generally runs fine. However I used to have a problem that
    > occasionally the website could no longer get a connection to the DB. I
    > had noticed that this always happened after I had downloaded the DB
    > made some changes to the DB structure and uploaded it again. The ASP
    > code would always fail at connection BD connection line. The only
    > solution I found to resolve the problem would be to restart the
    > server! I tried switching to a DSN Less connection (used to use
    > ODBC... see my connection string below) but that also didn't prevent
    > it from happening.
    >
    > After having given up on trying to find out how not prevent this from
    > happening after uploading, I ended up figured out how to make all
    > changes to the DB with SQL commands which although a bit more
    > cumbersome (for me anyway!), did allow me to make the changes and have
    > the added benefit of not having to take the site offline for a couple
    > of mins so I could live with that.
    >
    > However... to my surprise I now have the same problem AND I have't
    > made any change the the DB myself! This is very annoying (especially
    > like now if it happens during the weekend and I have no service at the
    > hosting provider till mon!).
    >
    > Has anyone else had this experience? What is the cause? Is there a way
    > to prevent this from happening? Or at least a way to set it right
    > again without having to restart the server? Since the problem appears
    > NOT to be with the Database (if I download it locally it works fine),
    > it would lead me to belive it has something to do with the Access
    > driver. I had tried to use the OLEDB driver, but several of my queries
    > did not work or gave different results to the Access Driver.
    >
    > Hoping there is an "easy" fix!
    >
    > Thanks for any help in advance,
    >
    >
    > Quintus
    >
    > ---
    > <%
    >
    > 'response.Redirect("../default_temp.asp")
    > 'response.end
    >
    > Dim conn
    > Set conn = Server.CreateObject("ADODB.Connection")
    > 'ConnStr = "DSN=toucanart"
    >
    > dbpath = "d:/http/toucanart.net/Databases/project21.mdb"
    >
    > 'ConnStr="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="
    > 'ConnStr=ConnStr & dbpath & ";"
    >
    > 'ConnStr=ConnStr & "Password=whatever;"
    >
    >
    > ConnStr2="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & dbpath
    >
    > ConnStr="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & dbpath
    >
    > conn.open ConnStr
    >
    > '---- CursorTypeEnum Values ----
    > Const adOpenForwardOnly = 0
    > Const adOpenKeyset = 1
    > Const adOpenDynamic = 2
    > Const adOpenStatic = 3
    >
    > '---- LockTypeEnum Values ----
    > Const adLockReadOnly = 1
    > Const adLockPessimistic = 2
    > Const adLockOptimistic = 3
    > Const adLockBatchOptimistic = 4
    >
    > '---- CursorLocationEnum Values ----
    > Const adUseServer = 2
    > Const adUseClient = 3
    > %>


    Bob Barrows Guest

  4. #3

    Default Re: Problem getting connction to Access DB using ASP

    My server does not give very detailed error message. Since it's hosted
    in DE, I get some German error message, it always gives an error
    message on the line htat contains "conn.open ConnStr".

    Do you know what exactly the difference it between the Access Driver
    and the Jet OLEDB one?
    Obviously one thing it does interpret the SQL statements differently
    as when I tried it, although most of the website worked, certain parts
    were giving different results! If I knew a bit more about what was
    different make it easier to update the site as now there are so many
    queries all over the place will take ages to find and check all of
    them.

    BTW, I finally managed to get it working again without restarting the
    server, but removing the line "ConnStr="DRIVER={Microsoft Access
    Driver (*.mdb)};DBQ=" & dbpath", trying to access the site (naturally
    didn't work) and then adding it again!

    Quintus

    "Bob Barrows" <reb_01501@yahoo.com> wrote in message news:<O7PWs60XDHA.2516@TK2MSFTNGP09.phx.gbl>...
    > You need to tell us the error message. You should avoid using ODBC, as the
    > Jet OLEDB provider will have the most features and provide the most robust
    > connection. I know your experience argues against the latter, but without
    > the error message, it's pretty hard for us to troubleshoot ...
    >
    > I do recall that compacting a database will sometimes cause permissions
    > problems (IUSR no longer has permissions for the compacted database), so
    > that's the first thing I would investigate. Instead of restarting the
    > server, explicitly grant Change permissions on the newly uploaded database
    > to the IUSR account.
    >
    > Bob Barrows
    >
    > Quintus Snapper wrote:
    > > I have a website running on a Win2000 Machine (IIS), and it's
    > > programmed in ASP and uses an Access 2000 DB.
    > >
    > > The site generally runs fine. However I used to have a problem that
    > > occasionally the website could no longer get a connection to the DB. I
    > > had noticed that this always happened after I had downloaded the DB
    > > made some changes to the DB structure and uploaded it again. The ASP
    > > code would always fail at connection BD connection line. The only
    > > solution I found to resolve the problem would be to restart the
    > > server! I tried switching to a DSN Less connection (used to use
    > > ODBC... see my connection string below) but that also didn't prevent
    > > it from happening.
    > >
    > > After having given up on trying to find out how not prevent this from
    > > happening after uploading, I ended up figured out how to make all
    > > changes to the DB with SQL commands which although a bit more
    > > cumbersome (for me anyway!), did allow me to make the changes and have
    > > the added benefit of not having to take the site offline for a couple
    > > of mins so I could live with that.
    > >
    > > However... to my surprise I now have the same problem AND I have't
    > > made any change the the DB myself! This is very annoying (especially
    > > like now if it happens during the weekend and I have no service at the
    > > hosting provider till mon!).
    > >
    > > Has anyone else had this experience? What is the cause? Is there a way
    > > to prevent this from happening? Or at least a way to set it right
    > > again without having to restart the server? Since the problem appears
    > > NOT to be with the Database (if I download it locally it works fine),
    > > it would lead me to belive it has something to do with the Access
    > > driver. I had tried to use the OLEDB driver, but several of my queries
    > > did not work or gave different results to the Access Driver.
    > >
    > > Hoping there is an "easy" fix!
    > >
    > > Thanks for any help in advance,
    > >
    > >
    > > Quintus
    > >
    > > ---
    > > <%
    > >
    > > 'response.Redirect("../default_temp.asp")
    > > 'response.end
    > >
    > > Dim conn
    > > Set conn = Server.CreateObject("ADODB.Connection")
    > > 'ConnStr = "DSN=toucanart"
    > >
    > > dbpath = "d:/http/toucanart.net/Databases/project21.mdb"
    > >
    > > 'ConnStr="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="
    > > 'ConnStr=ConnStr & dbpath & ";"
    > >
    > > 'ConnStr=ConnStr & "Password=whatever;"
    > >
    > >
    > > ConnStr2="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & dbpath
    > >
    > > ConnStr="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & dbpath
    > >
    > > conn.open ConnStr
    > >
    > > '---- CursorTypeEnum Values ----
    > > Const adOpenForwardOnly = 0
    > > Const adOpenKeyset = 1
    > > Const adOpenDynamic = 2
    > > Const adOpenStatic = 3
    > >
    > > '---- LockTypeEnum Values ----
    > > Const adLockReadOnly = 1
    > > Const adLockPessimistic = 2
    > > Const adLockOptimistic = 3
    > > Const adLockBatchOptimistic = 4
    > >
    > > '---- CursorLocationEnum Values ----
    > > Const adUseServer = 2
    > > Const adUseClient = 3
    > > %>
    Quintus Snapper Guest

  5. #4

    Default Re: Problem getting connction to Access DB using ASP

    Quintus Snapper wrote:
    > My server does not give very detailed error message. Since it's hosted
    > in DE, I get some German error message, it always gives an error
    > message on the line htat contains "conn.open ConnStr".
    Do you get an error number?
    >
    > Do you know what exactly the difference it between the Access Driver
    > and the Jet OLEDB one?
    The difference is one uses the older ODBC technology, which is being phased
    out, and the other uses the newer OLEDB technology.
    > Obviously one thing it does interpret the SQL statements differently
    > as when I tried it, although most of the website worked, certain parts
    > were giving different results!
    Example, please?
    > If I knew a bit more about what was
    > different make it easier to update the site as now there are so many
    > queries all over the place will take ages to find and check all of
    > them.
    >
    > BTW, I finally managed to get it working again without restarting the
    > server, but removing the line "ConnStr="DRIVER={Microsoft Access
    > Driver (*.mdb)};DBQ=" & dbpath", trying to access the site (naturally
    > didn't work) and then adding it again!
    >
    I don't understand this sequence of events.

    Bob


    Bob Barrows Guest

  6. #5

    Default Re: Problem getting connction to Access DB using ASP

    I have had a similar problem with my web server. The ASP works fine,
    everything is great, and then once in a while, when I log into the server,
    I'll have the MS script debugger waiting for me to skip the debugging.
    There is no problem with the script, its flawless and works on other
    machines connecting to DB's just fine without these issues.




    "Quintus Snapper" <qsnapper@terra.es> wrote in message
    news:29c2044a.0308100503.2719b86@posting.google.co m...
    > I have a website running on a Win2000 Machine (IIS), and it's
    > programmed in ASP and uses an Access 2000 DB.
    >
    > The site generally runs fine. However I used to have a problem that
    > occasionally the website could no longer get a connection to the DB. I
    > had noticed that this always happened after I had downloaded the DB
    > made some changes to the DB structure and uploaded it again. The ASP
    > code would always fail at connection BD connection line. The only
    > solution I found to resolve the problem would be to restart the
    > server! I tried switching to a DSN Less connection (used to use
    > ODBC... see my connection string below) but that also didn't prevent
    > it from happening.
    >
    > After having given up on trying to find out how not prevent this from
    > happening after uploading, I ended up figured out how to make all
    > changes to the DB with SQL commands which although a bit more
    > cumbersome (for me anyway!), did allow me to make the changes and have
    > the added benefit of not having to take the site offline for a couple
    > of mins so I could live with that.
    >
    > However... to my surprise I now have the same problem AND I have't
    > made any change the the DB myself! This is very annoying (especially
    > like now if it happens during the weekend and I have no service at the
    > hosting provider till mon!).
    >
    > Has anyone else had this experience? What is the cause? Is there a way
    > to prevent this from happening? Or at least a way to set it right
    > again without having to restart the server? Since the problem appears
    > NOT to be with the Database (if I download it locally it works fine),
    > it would lead me to belive it has something to do with the Access
    > driver. I had tried to use the OLEDB driver, but several of my queries
    > did not work or gave different results to the Access Driver.
    >
    > Hoping there is an "easy" fix!
    >
    > Thanks for any help in advance,
    >
    >
    > Quintus
    >
    > ---
    > <%
    >
    > 'response.Redirect("../default_temp.asp")
    > 'response.end
    >
    > Dim conn
    > Set conn = Server.CreateObject("ADODB.Connection")
    > 'ConnStr = "DSN=toucanart"
    >
    > dbpath = "d:/http/toucanart.net/Databases/project21.mdb"
    >
    > 'ConnStr="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="
    > 'ConnStr=ConnStr & dbpath & ";"
    >
    > 'ConnStr=ConnStr & "Password=whatever;"
    >
    >
    > ConnStr2="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & dbpath
    >
    > ConnStr="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & dbpath
    >
    > conn.open ConnStr
    >
    > '---- CursorTypeEnum Values ----
    > Const adOpenForwardOnly = 0
    > Const adOpenKeyset = 1
    > Const adOpenDynamic = 2
    > Const adOpenStatic = 3
    >
    > '---- LockTypeEnum Values ----
    > Const adLockReadOnly = 1
    > Const adLockPessimistic = 2
    > Const adLockOptimistic = 3
    > Const adLockBatchOptimistic = 4
    >
    > '---- CursorLocationEnum Values ----
    > Const adUseServer = 2
    > Const adUseClient = 3
    > %>

    Wes 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