主题:  关于asp 网页更新数据库的问题?

mtfxue1976

职务:普通成员
等级:1
金币:0.0
发贴:7
#12005/3/20 15:53:24
为什么我在网页上输入要求加入数据库的内容就提示下面的信息
错误类型:
Microsoft JET Database Engine (0x80040E09)
不能更新。数据库或对象为只读。
/jecom/Star0202.asp, 第 54 行

这是怎么回事,麻烦那位高手给我指点一下?
谢谢了!
下面是程序
<%@ Language=JScript %>

<!-- #include file="proc/StarProc.inc" -->

<%
var objRs, strRs, strToday;
var intI, intAge, intAgevalue;
var intShopNum, strMsg;

var strAgeArray = new Array('20 以下', '20 ~ 29', '30 ~ 39',
                '40 ~ 49', '50 ~ 59', '60(含)以上');
strToday = getToday();

if(Request('UserID') == '' || Request('Pswd') == '' ||
Request('RecPswd') == '' || Request('name') == '' ||
Request('address') == '') {
    strMsg = '粗体字之栏位未输入';
    Response.Redirect('Star0102.asp?msg=' + strMsg);
}
else {
    if(Request('Pswd')(1) != Request('RecPswd')(1)) {
     strMsg = '通行码与确认通行码应该相同';
     Response.Redirect('Star0102.asp?msg=' + strMsg);
    }
}

strRs = 'SELECT * ' +
        'FROM shopID ' +
        'WHERE userID = \'' + Request('UserID')(1) + '\'';

objRs = Server.CreateObject('ADODB.Recordset');
objRs.open(strRs, Application('strCn'));

if(! objRs.EOF) {
    objRs = null;
    strMsg = '识别名称重复,请另设定';
    Response.Redirect('Star0102.asp?msg=' + strMsg);
}

objRs.Close();
strRs = 'SELECT * ' +
        'FROM shopID ' +
        'ORDER BY shopNo';
objRs.Open(strRs, Application('strCn'), 2, 2);

if(objRs.EOF) {
    intShopNum = 1;
}
else {
    objRs.MoveLast();
    intShopNum = objRs.Fields('shopNo').value + 1;
}

objRs.AddNew();
objRs('userID') = Request('UserID');
objRs('password') = Request('Pswd');
objRs('shopNo') = intShopNum;
objRs.Update();
objRs.Close();

objRs.Open('shopper', Application('strCn'), 2, 2);

for(intI = 0; intI < strAgeArray.length; intI++) {

    if(Request('age') == strAgeArray[intI]) {
     intAge = intI;
     break;
    }

}

if(intAge == 0) {
    intAgevalue = 19;
}
else {
    intAgevalue = (intAge + 1) * 10;
}

objRs.AddNew();
objRs('shopNo') = intShopNum;
objRs('name') = Request('name');
objRs('tel') = Request('tel');
objRs('address') = Request('address');
objRs('email') = Request('mail');
objRs('sex') = Request('sex');
objRs('age') = intAgevalue;
objRs('regDate') = strToday;
objRs.Update();
Response.Cookies('strLogonSuccess') = 'OK';
putUser(objRs);
objRs = null;
%>

<html>
<body>
    <center>
     <h2 style="colorlive">
        <% = getUser() %>您已成功加入会员,请准备购物。</h2>
     <hr>
    </center>
    <table align="center">
     <tr>
        <td colspan="2">本网站购物</td>
     </tr>
     <tr>
        <td width="40"></td>
        <td>满 NT$
         <font color="deepskyblue">1,500</font> 元可享
         <font color="blue">九五</font> 折,
        </td>
     <tr>
        <td width="40"></td>
        <td>满 NT$
         <font color="darkcyan">3,000</font> 元可享
         <font color="green">九</font> 折,
        </td>
     </tr>
     <tr>
        <td width="40"></td>
        <td>满 NT$
         <font color="coral">5,000</font> 元可享
         <font color="red">八五</font> 折优惠,
        </td>
     </tr>
     <tr>
        <td colspan="2" align="center">请多多利用!</td>
     </tr>
    </table>

    <%
     showLogo();
    %>

</body>
</html>

编辑历史:[此帖最近一次被 mtfxue1976 编辑过(编辑时间:2005-03-20 16:01:42)]


蓝鲸

职务:版主
等级:5
金币:42.1
发贴:2614
#22005/3/20 18:17:12
检查目录或虚拟目录有没有写入的权限


非常大鱼

6319

职务:普通成员
等级:1
金币:0.0
发贴:1
#32005/3/20 18:42:06
使用什么操作系统?



mtfxue1976

职务:普通成员
等级:1
金币:0.0
发贴:7
#42005/3/20 20:39:20
谢谢了,我看了以前的帖子这个问题解决了!
再次感谢!