参数类型不正确,请求帮助
错误类型:ADODB.Recordset (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/TestDemo/reg_save.asp, 第 14 行
if userpwd=userpwd2 then
sql="select * from T_User"
set rs=server.CreateObject("adodb.recordset")
rs.Open sql,conn,1,3 ------------此处14行
rs.addnew
rs("username")=username
rs("userpwd")=userpwd
rs("userpwd2")=userpwd2
rs("email")=email
数据可连接:
If IsSqlDataBase = 1 Then
'-----------------------SQL数据库连接参数---------------------------------------
Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName
NowString = "GetDate()"
SqlDatabaseName = "newasp" '数据库名
SqlUsername = "sa" '用户名
SqlPassword = "newasp" '用户密码
SqlLocalName = "(local)" '连接名(本地用local,外地用IP)
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
'-------------------------------------------------------------------------------
Else
'-----------------------ACCESS数据库连接----------------------------------------
NowString = "Now()"
'ACCESS数据库连接,请使用根路径或者绝对路径
'db = "\database\#newasp.mdb"
db = "database/#newasp.mdb"
Connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
'-------------------------------------------------------------------------------
End If
#newasp.mdb数据库是有T_User表的.
rs.update
response.Write("<font size='3'>谢谢使用,添加成功,数据已保存到数据库。 请点击 <a href='reg.asp'><font color='#0033FF'>返回</font></a> </font>")
else
response.Write("两次输入的密码不正确,请重新输入。")
end if