ADODB.Command 错误 '800a0d5d'
小弟正在跟着书学ASP+ACCESS数据库,用的Dreamweaver,代码是自动生成的,有个用户注册的界面一提交就出错ADODB.Command错误'800a0d5d'...
小弟正在跟着书学ASP+ACCESS数据库,用的Dreamweaver,代码是自动生成的,有个用户注册的界面一提交就出错
ADODB.Command 错误 '800a0d5d'
应用程序在当前操作中使用了错误类型的值。
/register1.asp,行 51
页面是上传在小弟的动态空间里的,所以大家也可以直接浏览 http://flashowner.cn/register1.asp
还有就是小弟在自己机器上本地测试的时候用的DSN连接却没有问题。空间上用的是自定义字符串连接数据库,连接没有问题
下面是51行及其附近的代码:
var MM_editCmd = Server.CreateObject ("ADODB.Command");
MM_editCmd.ActiveConnection = MM_conn_STRING;
MM_editCmd.CommandText = "INSERT INTO [user] ([User], Password, cPassword, [key], email, sex) VALUES (?, ?, ?, ?, ?, ?)";
MM_editCmd.Prepared = true;
MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param1", 201, 1, 18, Request.Form("username"))); // adLongVarChar
MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param2", 201, 1, 16, Request.Form("password"))); // adLongVarChar
MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param3", 201, 1, 50, Request.Form("password2"))); // adLongVarChar
MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param4", 201, 1, 50, Request.Form("passwd"))); // adLongVarChar
MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param5", 201, 1, 50, Request.Form("email"))); // adLongVarChar
MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param6", 201, 1, 2, Request.Form("sex"))); // adLongVarChar 这是51行
MM_editCmd.Execute();
MM_editCmd.ActiveConnection.Close();
// append the query string to the redirect URL
var MM_editRedirectUrl = "registerSuccess.htm";
if (MM_editRedirectUrl && Request.QueryString && Request.QueryString.Count > 0) {
MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') == -1) ? "?" : "&") + Request.QueryString;
}
Response.Redirect(MM_editRedirectUrl)
}
}
%><html> 展开
ADODB.Command 错误 '800a0d5d'
应用程序在当前操作中使用了错误类型的值。
/register1.asp,行 51
页面是上传在小弟的动态空间里的,所以大家也可以直接浏览 http://flashowner.cn/register1.asp
还有就是小弟在自己机器上本地测试的时候用的DSN连接却没有问题。空间上用的是自定义字符串连接数据库,连接没有问题
下面是51行及其附近的代码:
var MM_editCmd = Server.CreateObject ("ADODB.Command");
MM_editCmd.ActiveConnection = MM_conn_STRING;
MM_editCmd.CommandText = "INSERT INTO [user] ([User], Password, cPassword, [key], email, sex) VALUES (?, ?, ?, ?, ?, ?)";
MM_editCmd.Prepared = true;
MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param1", 201, 1, 18, Request.Form("username"))); // adLongVarChar
MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param2", 201, 1, 16, Request.Form("password"))); // adLongVarChar
MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param3", 201, 1, 50, Request.Form("password2"))); // adLongVarChar
MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param4", 201, 1, 50, Request.Form("passwd"))); // adLongVarChar
MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param5", 201, 1, 50, Request.Form("email"))); // adLongVarChar
MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param6", 201, 1, 2, Request.Form("sex"))); // adLongVarChar 这是51行
MM_editCmd.Execute();
MM_editCmd.ActiveConnection.Close();
// append the query string to the redirect URL
var MM_editRedirectUrl = "registerSuccess.htm";
if (MM_editRedirectUrl && Request.QueryString && Request.QueryString.Count > 0) {
MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') == -1) ? "?" : "&") + Request.QueryString;
}
Response.Redirect(MM_editRedirectUrl)
}
}
%><html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询