连接字符串混乱 [英] Connection string confusion

查看:50
本文介绍了连接字符串混乱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从未真正理解连接字符串。我不知道为什么,因为我不是那么聪明的家伙,但是我无法理解我在那里看到的任何解释。过去7年左右,我一直在做ASP。

我已经设法通过复制现有连接

字符串,并进行更改直到它工作。


然而,这一次,我感到很茫然。我有一个ASP 3应用程序,现在在我的

本地计算机(WinXP Pro)上,但将上传到真正的主机上

查看我的成员 - 只有网站。它将使用SQL Server 2005.我有它使用Access可以正常运行
,但是我不得不将数据库移到SQL Server,

,因为它就是它的原因我将参与制作。


我尝试过各种不同尝试的变体,你可以在下面看到。我有

阅读 www.connectionstrings.com www.aspfaq.com 。


我目前有SQL Server设置为Windows身份验证。我没有为混合模式设置它的问题,但是还没弄清楚原因。

我已经确认IUSR_(machinename)是用户的机器。


我得到的错误,取决于我做出的各种尝试,通常是某种权限错误。
。任何帮助表示赞赏。


strDBConnection = _


" Provider = SQLOLEDB; Persist Security Info = False; Data Source = machinename;" &

_


"用户ID =用户ID;密码=密码;数据库= 1;"


Dim objConnection


设置objConnection = Server.CreateObject(" ADODB.Connection")

objConnection.Open strDBConnection






strDBConnection =" Provider = SQLOLEDB;" &安培; _


"数据源=< machinename> \< SQLEXPRESS> ;;" &安培; _


" Initial Catalog =< shape> ;;" &安培; _


Integrated Security = SSPI

set conn = CreateObject(" ADODB.Connection")

conn.open strDBConnection




set db = Server.CreateObject(" ADODB.Connection")


strConnect =" Provider = SQLOLEDB;数据源= machinename;初始

目录=形状;用户ID = userid;密码=密码;网络库= dbmssocn;"





strConnect =" Provider = SQLOLEDB; Driver = SQL

服务器;服务器=机器名;数据库=形状;"


db.Open strConnect

解决方案

我目前为SQL身份验证设置了SQL Server。我没有


问题将其设置为混合模式,但还没弄清楚原因。



应该说:


但是还没弄明白*怎么样。*


" Middletree"写道:


>我目前有为Windows身份验证设置的SQL Server。我没有问题为混合模式设置它,但没有想到
为什么。



应该说:


但是还没弄明白*怎么样。*



SQL Server管理工作室

右键单击服务器,选择属性

单击安全性

将身份验证设置为所需模式


-

戴夫安德森


未经请求的商业电子邮件将被收取费用每个消息的


500。使用

此电子邮件地址表示同意这些条款。


I have never really understood connection strings. I''m not sure why, as I''m
a smart guy otherwise, but I cannot make sense of any of the explanations I
have seen out there over the past 7 or so years that I have been doing ASP.
I have somehow just managed to get by with copying existing connections
strings, and making changes until it works.

This time, however, I am at a loss. I have an ASP 3 app, which is on my
local machine (WinXP Pro) for now, but will be uploaded to a real host for
viewing my on a members-only site. It will use SQL Server 2005. I had it
working fine with Access, but I had to move the db over to SQL Server,
because that''s what it''s going to be in Production.

I have tried variations of the different attempts you can see below. I have
read www.connectionstrings.com and www.aspfaq.com.

I currently have SQL Server set for Windows Authentication. I have no
problem setting it for Mixed Mode, but have not figured out why.

I have verified that IUSR_(machinename) is a user on the machine.

The errors I get, depending on which of the various attempts I make, are
usually some sort of permissions error. Any help appreciated.

strDBConnection = _

"Provider=SQLOLEDB;Persist Security Info=False;Data Source=machinename;" &
_

"User ID=userid;Password=password;Database=1;"

Dim objConnection

Set objConnection = Server.CreateObject("ADODB.Connection")

objConnection.Open strDBConnection


and

strDBConnection = "Provider=SQLOLEDB;" & _

"Data Source=<machinename>\<SQLEXPRESS>;" & _

"Initial Catalog=<shape>;" & _

"Integrated Security=SSPI"
set conn = CreateObject("ADODB.Connection")

conn.open strDBConnection

and

set db = Server.CreateObject("ADODB.Connection")

strConnect = "Provider=SQLOLEDB; Data Source=machinename; Initial
Catalog=shape; User ID=userid; Password=password; Network Library=dbmssocn;"

and

strConnect = "Provider=SQLOLEDB;Driver=SQL
Server;Server=machinename;Database=shape;"

db.Open strConnect

解决方案

I currently have SQL Server set for Windows Authentication. I have no

problem setting it for Mixed Mode, but have not figured out why.

that should say:

but have not figured out *how.*


"Middletree" wrote:

>I currently have SQL Server set for Windows Authentication. I
have no problem setting it for Mixed Mode, but have not figured
out why.


that should say:

but have not figured out *how.*

SQL Server Management Studio
Right-click on server, select Properties
Click on Security
Set authentication to desired mode


--
Dave Anderson

Unsolicited commercial email will be read at a cost of


500 per message. Use
of this email address implies consent to these terms.


这篇关于连接字符串混乱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆