<%@ language="vbscript" %>
<html>
<body>
<P>
<%
dim adOpenDynamic,adLockOptimistic,adCmdtext
adOpenDynamic=0
adLockoptimistic=1
adCmdtext=2
dim i
i=1
dim conn,rs,strsql
dim fname,lname,gender,month,date,year,uname,pwd,email
set conn=Server.Createobject("ADODB.Connection")
set rs=Server.Createobject("ADODB.Recordset")
conn.ConnectionString="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=myshoppe;Data Source=NVC-10\SQLEXPRESS"
conn.Open
fname=Request.Form("first_name")
lname=Request.Form("last_name")
gender=Request.Form("gender")
'month=Request.Form("Month")
'date=Request.Form("date")
'year=Request.Form("year")
email=Request.Form("email")
uname=Request.Form("user_name")
pwd=Request.Form("pwd")
strsql = "INSERT INTO user_info(fname, lname, gender, email, uname, pwd) VALUES(' " & fname & "',' " & lname &"',' " & gender & "', "& email & "',' " & uname & "',' " & pwd & "')"
conn.Execute (strsql)
Response.Write("submitted<>")
Response.Write "Connected OK"
%>
<br>
</P>
</body>
</html>
Microsoft OLE DB提供用于拒绝了对对象 'user_info的' SQL 服务器(0x80040E09)INSERT权限 ,数据库 'myshoppe',架构 'DBO'。连接错误vbscript sqlserver?
'Integrated Security = SSPI'将表示您的脚本可能以ASPNET,IIS_IUSR或IIS_WPG用户身份运行。检查用户是否在SQL Server中具有正确的权限。否则,如果它是错误的用户,您可以选择更改ASP后运行的用户。 – 2012-02-05 09:32:27