标题:错误原因:[Microsoft][ODBC 驱动程序管理器] 驱动程序的 SQLSetConnectAttr ...
只看楼主
a1314517
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-3-6
 问题点数:0 回复次数:0 
错误原因:[Microsoft][ODBC 驱动程序管理器] 驱动程序的 SQLSetConnectAttr 失败

错误原因:[Microsoft][ODBC Microsoft Access Driver]常见错误 不能打开注册表关键字 'Temporary (volatile) Jet DSN for process 0xc8 Thread 0x8f0 DBC 0x7a6024 Jet'。
错误原因:[Microsoft][ODBC 驱动程序管理器] 驱动程序的 SQLSetConnectAttr 失败

在对数据库中的数据进行更新的时候出现如上错误?
代码如下:

<!--#include file="conn.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>会员资料修改</title>
<style type="text/css">
<!--
body {
margin-top: 0px;
margin-bottom: 0px;
background-image: url();
background-repeat: no-repeat;
}
.STYLE1 {color: #FF0000}
-->
</style></head>
<body>
<%
set rst=server.CreateObject("adodb.recordset")
on error resume next
id=request.QueryString("id")
if request.QueryString("act")="modify" then
conn.begintrans '开启事务
'sql="update user set u_user='"& request.Form("f_user")&"',u_code='"& request.Form("f_code")&"' where u_id="& id
'sql1="update info set i_name='"& request.Form("f_name")&"',i_sex='"& request.Form("f_sex")&"'"
'sql1=sql1&",i_age=" &request.Form("f_age")&",i_vip="
'if request.Form("f_vip")=1 then
'sql1=sql1&"true"
'else
'sql1=sql1&"false"
'end if
'sql1=sql1+ " where i_uid= "& id
'conn.execute sql
'conn.execute sql1
set myErrors=conn.errors
if myErrors.count>0 then
for i=0 to myErrors.count-1
response.write("错误原因:"& myErrors.item(i).description & "<br>")
next
end if
if err.number<>0 then
response.write"err错误原因:" &err.description
end if
rst.open "select * from user where u_id=" &id,conn,1,3
rst("u_user")=request.Form("f_user")
rst("u_code")=request.Form("f_code")
rst.update
rst.close
rst.open"select * from info where i_uid=" &id,conn,1,3
rst("i_name")=request.Form("f_name")
rst("i_sex")=request.Form("f_sex")
rst("i_age")=request.Form("f_age")
if request.Form("f_vip")=1 then
rst("i_vip")=true
else
rst("i_vip")=false
end if
rst.update
rst.close
if err.number<>0 then
conn.rollbacktrans '取消事务更改并结束事务
response.Write "修改会员失败!"
else
conn.committrans '保存事务更改并结束事务
response.write "修改会员成功!"
end if
end if
%>
<%=id%>
<table width="800" height="573" border="0" align="center" cellspacing="0">
<tr>
<td height="573" align="center" valign="top" background="img/hyzlxg.jpg"><table width="800" border="0" cellspacing="0">
<tr>
<td width="73" height="164">&nbsp;</td>
<td width="646">&nbsp;</td>
<td width="75">&nbsp;</td>
</tr>
<tr>
<td height="337">&nbsp;</td>
<td align="center" valign="middle" bgcolor="#F9F9F9"><a href="admin.asp">返回会员列表</a>
<%
rst.open"select * from user where u_id="& request.QueryString("id"), conn,1,1
%>
<form id="form1" name="form1" method="post" action="modify.asp?act=modify&id=<% request.QueryString("id")%>">
<table width="90%" border="1" align="center" cellpadding="5" cellspacing="0">
<tr>
<td colspan="3">请在下面修改会员资料,红色<span class="STYLE1">*</span>号所标示的选项为必填项</td>
</tr>
<tr>
<td width="24%" align="right">用户名:</td>
<td width="37%" align="left"><input name="f_user" type="text" id="f_user" value="<%=rst("u_user")%>"/></td>
<td width="39%" align="left"><span class="STYLE1">*
</span></td>
</tr>
<tr>
<td align="right">密码:</td>
<td align="left"><input name="f_code" type="text" id="f_code" value="<%=rst("u_code")%>"/></td>
<td align="left"><span class="STYLE1">*</span></td>
</tr>
<%
rst.close
rst.open"select * from info where i_uid="&request.QueryString("id"),conn,1,1
%>
<tr>
<td align="right">姓名:</td>
<td align="left"><input name="f_name" type="text" id="f_name" value="<%=rst("i_name")%>"/></td>
<td align="left"><span class="STYLE1">*</span></td>
</tr>
<tr>
<td align="right">性别:</td>
<td align="left"><select name="f_sex" id="f_sex">
<option value="男" selected="selected">男</option>
<option value="女"<% if rst("i_sex")="女" then response.write"selected"%>>女</option>
</select>

</td>
<td align="left"><span class="STYLE1">*</span></td>
</tr>
<tr>
<td align="right">年龄:</td>
<td align="left"><input name="f_age" type="text" id="f_age" size="8" value="<%=rst("i_age")%>"/></td>
<td align="left"><span class="STYLE1">*</span></td>
</tr>
<tr>
<td align="right">是否会员:</td>
<td align="left"><input name="f_vip" type="radio" value="1" checked <% if rst("i_vip") then response.Write("checked")%> />

<input type="radio" name="f_vip" value="0" <% if not rst("i_vip") then response.Write("checked")%> />否

</td>
<td align="left"><span class="STYLE1">*</span></td>
</tr>
<%
rst.close
%>
<tr>
<td colspan="3" align="center"><input type="submit" name="Submit" value="修改会员资料" />
&nbsp;&nbsp;&nbsp;
<input type="reset" name="Submit2" value="重置表单" /></td>
</tr>
</table>
</form>
</td>
<td>&nbsp;</td>
</tr>
</table></td>
</tr>
</table>
<%
set rst=nothing
conn.close
set conn=nothing
%>
</body>
</html>

请asp高手有空帮忙看看!谢谢.

搜索更多相关主题的帖子: 错误原因 Microsoft ODBC 管理器 数据库 
2007-03-06 21:32



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-122801-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.052063 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved