vbscript sqlserver 连接错误?
<%@ 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>
用于 SQL 的 Microsoft OLE DB 提供程序 服务器(0x80040E09)插入权限 拒绝对象“user_info”、数据库 'myshoppe',模式'dbo'。
<%@ 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 Provider for SQL
Server (0x80040E09) INSERT permission
denied on object 'user_info', database
'myshoppe', schema 'dbo'.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的电子邮件变量之前需要一个左单引号。
You need an opening single quote before your email variable.