简体   繁体   English

使用VBScript连接到SQL Server 2008 R2 Express

[英]Connecting to SQL Server 2008 R2 Express with VBScript

So I have the following vbscript to updatea table on a SQL Server 2008 R2 Express instance on my local machine which works as expected: 因此,我使用以下vbscript来更新本地计算机上按预期工作的SQL Server 2008 R2 Express实例上的表:

Const adOpenStatic = 3
Const adLockOptimistic = 3
Const DB_CONNECT_STRING = "Provider=SQLOLEDB.1;Data Source=mycomputerName\SQLEXPRESS;Initial Catalog=Purchasing;Integrated Security=SSPI"

Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")

objConnection.Open DB_CONNECT_STRING

Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConnection
objCommand.CommandText = "UPDATE Budget SET Current_Budget='2999.00' WHERE Manager_ID='8869'"
objCommand.Execute
objConnection.Close

The problem I'm facing is that when I change: 我面临的问题是当我更改时:

Integrated Security=SSPI

to: 至:

user id='user';password='password

it tells me I'm unable to login (using user in the form of DOMAIN\\user), which is a problem because I intend to use this vbscript on an internal website, so I need to be able to specify. 它告诉我无法登录(使用DOMAIN \\ user形式的用户),这是一个问题,因为我打算在内部网站上使用此vbscript,因此需要指定。 Looking for any ideas? 寻找任何想法?

您是否检查服务器身份验证是否为混合模式?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM