Cannot update database after moving website

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

  1. #1

    Default Cannot update database after moving website

    Hi,

    I got a problem on updating the database after moving the
    website from my old computer to a new one. The old and
    the new computers are running WindowsXP and the new
    computer installed MDAC2.8 and Jet7.

    Recently, I got 2 websites running on the new computer
    and both of them having problem when updating the
    database.

    1: It saying that the database is write protected with
    error code: Microsoft OLE DB Provider for ODBC Drivers
    (0x80004005)

    2: It saying that it needs an updating query for updating
    the database with error code: Microsoft OLE DB Provider
    for ODBC Drivers (0x80004005)

    the code of the page are as following:
    1:
    <!-- #include file = "admin.inc" -->

    <%
    if request("todo") = "update" then
    dim sqlstr

    set adocon = server.createobject
    ("adodb.connection")
    adocon.open application("db_driver") &
    server.mappath(application("db_path"))

    set rs = server.createobject
    ("adodb.recordset")

    sqlstr = "SELECT * FROM " & request
    ("type") &"_mslist WHERE msid=" & request("unitid")

    rs.open sqlstr, adocon, 1, 3

    rs("msid") = request("msdev")
    rs("num") = 1
    rs("needdiff") = 0
    rs.update

    rs.close
    set rs = nothing
    adocon.close
    set adocon = nothing
    end if
    %>

    <!doctype html public "-//W3C//DTD HTML 4.0
    Transitional//EN">
    <html>
    <head>
    <meta content="text/html; charset=x-sjis" http-
    equiv=Content-Type>
    <title>G-Generation Prefect Profile - Add New
    Formation</title>
    <link type="text/css" rel="stylesheet" href="g-gen.css">
    <script language="javascript">
    function init()
    {
    opener.location.reload();
    opener.focus();
    self.close();
    }

    </script>

    </head>
    <body onload="init();">
    </body>
    </html>

    2:
    <!-- #include file = "doDisplay.inc" -->

    <!doctype html public "-//W3C//DTD HTML 4.0
    Transitional//EN">
    <html>
    <head>
    <link rel="stylesheet" href="style.css"
    type="text/css">
    <link type="text/css" rel="stylesheet"
    href="style.css">
    <title>updating...</title>
    <script language="javascript"
    src="jscript.js"></script>
    <script language="javascript"
    src="popup.js"></script>
    </head>
    <body onload="resizeWin(widthWinBig,
    heightWinBig);">
    <form name='details' action='update.asp'
    method='post'>
    <input type='hidden' name='id'
    value='<% = request("id")%>'>
    <input type='hidden' name='name'
    value='<% = request("name")%>'>
    <input type='hidden' name='code'
    value='<% = request("code")%>'>
    <input type='hidden' name='media'
    value='<% = request("media")%>'>
    <input type='hidden'
    name='remark' value='<% = request("remark")%>'>
    <input type='hidden' name='todo'
    value='byPass'>
    </form>
    <%
    dim sqlstr

    set adocon = server.createobject
    ("adodb.connection")
    adocon.open application
    ("db_driver") & server.mappath(application("db_path"))

    set rs = server.createobject
    ("adodb.recordset")

    sqlstr = "SELECT * FROM cartoons
    WHERE name='"&request("name")&"' AND id<>"&request("id")

    rs.cursorlocation = 3
    rs.open sqlstr, adocon, 3, 1

    if rs.recordcount = 0 or request
    ("todo") = "byPass" then
    doUpdate adocon
    else
    doDisplay rs
    end if

    rs.close
    set rs = nothing

    adocon.close
    set adocon = nothing

    sub doUpdate(adocon)

    dim sqlstr
    dim content

    sqlstr="SELECT * FROM
    cartoons WHERE id="&request("id")

    set rs =
    server.createobject("adodb.recordset")

    rs.open sqlstr, adocon ,
    0, 3

    rs("name").value = request
    ("name")
    rs("code").value = request
    ("code")
    rs("media").value =
    request("media")
    rs("remark").value =
    request("remark")
    rs.update

    content = "<script
    language='javascript'>closeMe("&rs("id")&");</script>"

    response.write content

    end sub
    %>
    </body>
    </html>

    I am a newer to ASP, please help!!

    Best,
    Leo
    ..


    Leo Lam Guest

  2. Similar Questions and Discussions

    1. Moving SQL Server database from localhost to remote?
      Hello, I am doing my first project with MS SQL server 2000. Developing this with Access as a project has been fun.. but I am stumped now with how...
    2. Moving webblog to my website
      How do I make a Comment box in a webpage? I have a webblog with a 'comment link' that opens a little box. I want to move the blog and the comment...
    3. Update website
      The website http://www.photodevy.com is been updated. Greetings Devy
    4. moving a database from one server to another.
      NT 4.0, IDS 7.3 Hi all I'm moving a small database (4gb) from one server to another as a favour to a mate. I'm savvy with IDS on Unix but have...
    5. moving a database from 7.1 to 8.1.2 via backup image file
      I think the restore command does not recognize relative paths (./) ... Give the full path or I think omitting the from clause defaults to the...
  3. #2

    Default Re: Cannot update database after moving website

    "Leo Lam" <bearforeverfriends@hotmail.com> wrote in message
    news:12f401c3a879$9caabc10$a601280a@phx.gbl...
    > Hi,
    >
    > I got a problem on updating the database after moving the
    > website from my old computer to a new one. The old and
    > the new computers are running WindowsXP and the new
    > computer installed MDAC2.8 and Jet7.
    >
    > Recently, I got 2 websites running on the new computer
    > and both of them having problem when updating the
    > database.
    >
    > 1: It saying that the database is write protected with
    > error code: Microsoft OLE DB Provider for ODBC Drivers
    > (0x80004005)
    >
    > 2: It saying that it needs an updating query for updating
    > the database with error code: Microsoft OLE DB Provider
    > for ODBC Drivers (0x80004005)
    [url]http://www.aspfaq.com/database.asp[/url]

    --
    Tom Kaminski IIS MVP
    [url]http://www.iistoolshed.com/[/url] - tools, scripts, and utilities for running IIS
    [url]http://mvp.support.microsoft.com/[/url]
    [url]http://www.microsoft.com/windowsserver2003/community/centers/iis/[/url]



    Tom Kaminski [MVP] Guest

  4. #3

    Default Re: Cannot update database after moving website



    Leo Lam wrote:
    > I got a problem on updating the database after moving the
    > website from my old computer to a new one. The old and
    > the new computers are running WindowsXP and the new
    > computer installed MDAC2.8 and Jet7.
    >
    > Recently, I got 2 websites running on the new computer
    > and both of them having problem when updating the
    > database.
    >
    > 1: It saying that the database is write protected with
    > error code: Microsoft OLE DB Provider for ODBC Drivers
    > (0x80004005)
    Well, is the database write protected?
    > 2: It saying that it needs an updating query for updating
    > the database with error code: Microsoft OLE DB Provider
    > for ODBC Drivers (0x80004005)
    I think this occurs if the Windows XP user under which ASP pages are
    executed doesn't have access to the data base. Make sure that the user
    IUSR_hostname has the proper access to the directory the data base is
    in. Perhaps move the data base somewhere where you want ASP pages to
    have access to.

    --

    Martin Honnen
    [url]http://JavaScript.FAQTs.com/[/url]

    Martin Honnen Guest

  5. #4

    Default Re: Cannot update database after moving website

    Yes, it is because of the access right of the
    IUSR_hostname.

    I have try to change its group to administrators and the
    websites work again. But it is dangerous to do so.

    Do you know anyway to change the folder permission such
    that IUSR_hostname has write permission on that folder.
    I found no way to do so.

    Best,
    Leo

    >-----Original Message-----
    >
    >
    >Leo Lam wrote:
    >> I got a problem on updating the database after moving
    the
    >> website from my old computer to a new one. The old and
    >> the new computers are running WindowsXP and the new
    >> computer installed MDAC2.8 and Jet7.
    >>
    >> Recently, I got 2 websites running on the new computer
    >> and both of them having problem when updating the
    >> database.
    >>
    >> 1: It saying that the database is write protected with
    >> error code: Microsoft OLE DB Provider for ODBC Drivers
    >> (0x80004005)
    >
    >Well, is the database write protected?
    >
    >> 2: It saying that it needs an updating query for
    updating
    >> the database with error code: Microsoft OLE DB
    Provider
    >> for ODBC Drivers (0x80004005)
    >
    >I think this occurs if the Windows XP user under which
    ASP pages are
    >executed doesn't have access to the data base. Make sure
    that the user
    >IUSR_hostname has the proper access to the directory the
    data base is
    >in. Perhaps move the data base somewhere where you want
    ASP pages to
    >have access to.
    >
    >--
    >
    > Martin Honnen
    > [url]http://JavaScript.FAQTs.com/[/url]
    >
    >.
    >
    Leo Lam Guest

  6. #5

    Default Re: Cannot update database after moving website



    Leo Lam wrote:
    > Yes, it is because of the access right of the
    > IUSR_hostname.
    >
    > I have try to change its group to administrators and the
    > websites work again. But it is dangerous to do so.
    >
    > Do you know anyway to change the folder permission such
    > that IUSR_hostname has write permission on that folder.
    > I found no way to do so.
    With Windows Explorer, you right-click the folder, use properties and
    security, there you can set user rights. At least that is how I do it
    with Windows XP Professional.

    --

    Martin Honnen
    [url]http://JavaScript.FAQTs.com/[/url]

    Martin Honnen Guest

  7. #6

    Default Re: Cannot update database after moving website

    Thanks, Martin.

    I solve this problem now.

    WinXP will hide the security option orginally and I need
    to enable it again in the Folder option.

    Leo
    >-----Original Message-----
    >
    >
    >Leo Lam wrote:
    >
    >> Yes, it is because of the access right of the
    >> IUSR_hostname.
    >>
    >> I have try to change its group to administrators and
    the
    >> websites work again. But it is dangerous to do so.
    >>
    >> Do you know anyway to change the folder permission
    such
    >> that IUSR_hostname has write permission on that folder.
    >> I found no way to do so.
    >
    >With Windows Explorer, you right-click the folder, use
    properties and
    >security, there you can set user rights. At least that
    is how I do it
    >with Windows XP Professional.
    >
    >--
    >
    > Martin Honnen
    > [url]http://JavaScript.FAQTs.com/[/url]
    >
    >.
    >
    Leo Lam 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