VB Express SQL Express远程连接 [英] VB Express SQL Express Remote Connection

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

问题描述

我正在从VB6 / Access迁移到Visual Basic和SQL Express。我已经成功在我的本地计算机上编写了测试代码,并且现在正在为服务器设置

部署的测试。我在Windows 2003

本地计算机上连接和创建远程服务器上的数据库,所以我知道远程访问是工作的


但是,我无法使用VB

Express程序中的连接字符串进行连接。我正在使用带有

属性的SQL连接字符串生成器


Dim cn as SQLClient.DBConnectionStringBuilder = new

SQLClient.DBConnectionStringBuilder

cn.DataSource =" AppServer02 \SQLExpress"

cn.ApplicationName =" VBTest"

cn.AttachDBFilename =" testdb .mdf"

cn.IntegratedSecurity = True

cn.PersistSecurityInfo = False


我收到的错误是

连接到SQL Server 2005时,这种失败可能是由于SQL Server不允许远程连接的默认设置下的事实导致的。


我明白VB Express不支持通过

设计器进行远程连接,但我想我可以使用

连接字符串连接到远程数据库。


感谢您的帮助

解决方案

Cleo,


服务器名称可以访问服务器。而不是Jet引擎

(访问)及其文件地址。


事实上它比使用Jet更容易。


为什么不先尝试这个,这样做之后你几乎可以看到所有的东西都是好的。
http://www.vb-tips.com/dbpages.aspx?... 2-b1ed16424252


我希望这会有所帮助,


Cor


" ; CLEO" < cl ** @ discuss.microsoft.comschreef in bericht

新闻:C4 ************************** ******** @ microsof t.com ...


>我正在从VB6 / Access迁移到Visual Basic和SQL Express。我已经成功在我的本地机器上编写了测试代码,并且我现在正在设置测试

以便将

部署到服务器上。我在Windows 2003

本地计算机上连接和创建远程服务器上的数据库,所以我知道远程访问是工作的


但是,我无法使用VB

Express程序中的连接字符串进行连接。我正在使用带有

属性的SQL连接字符串生成器


Dim cn as SQLClient.DBConnectionStringBuilder = new

SQLClient.DBConnectionStringBuilder

cn.DataSource =" AppServer02 \SQLExpress"

cn.ApplicationName =" VBTest"

cn.AttachDBFilename =" testdb .mdf"

cn.IntegratedSecurity = True

cn.PersistSecurityInfo = False


我收到的错误是

当连接到SQL Server 2005时,这种失败可能是由于在默认设置下SQL Server不允许远程连接/ b $ b连接的事实导致的。

。 />

我明白VB Express不支持通过



设计器进行远程连接,但我想我可以连接到远程数据库使用

连接字符串。


感谢您的帮助



< blockquote>谢谢你回复

对不起,我无法访问您提供的链接。你能否向我提供一些额外的信息或不同的链接。

" Cor Ligthert [MVP]"写道:


Cleo,


服务器应该可以通过服务器名称访问。而不是Jet引擎

(访问)及其文件地址。


事实上它比使用Jet更容易。


为什么不先尝试这个,这样做之后你几乎可以看到所有的东西都是好的。
http://www.vb-tips.com/dbpages.aspx?... 2-b1ed16424252


我希望这会有所帮助,


Cor


" ; CLEO" < cl ** @ discuss.microsoft.comschreef in bericht

新闻:C4 ************************** ******** @ microsof t.com ...


我从VB6 / Access迁移到Visual Basic和SQL Express。我已经成功在我的本地机器上编写了测试代码,并且我现在正在设置测试

以便将

部署到服务器上。我在Windows 2003

本地计算机上连接和创建远程服务器上的数据库,所以我知道远程访问是工作的


但是,我无法使用VB

Express程序中的连接字符串进行连接。我正在使用带有

属性的SQL连接字符串生成器


Dim cn as SQLClient.DBConnectionStringBuilder = new

SQLClient.DBConnectionStringBuilder

cn.DataSource =" AppServer02 \SQLExpress"

cn.ApplicationName =" VBTest"

cn.AttachDBFilename =" testdb .mdf"

cn.IntegratedSecurity = True

cn.PersistSecurityInfo = False


我收到的错误是

当连接到SQL Server 2005时,这种失败可能是由于在默认设置下SQL Server不允许远程连接/ b $ b连接的事实导致的。

。 />

我明白VB Express不支持通过



设计器进行远程连接,但我想我可以连接到远程数据库使用

连接字符串。


感谢您的帮助




Cleo,


你能告诉我为什么你不能访问该链接吗?


因为这是Ken和我的网站。


提前致谢


Cor


" CLEO" < cl ** @ discussion.microsoft.comschreef in bericht

news:14 ************************** ******** @ microsof t.com ...


感谢您的回复

对不起但很抱歉我无法访问您提供的链接。你可以提供



一些额外的信息或不同的链接。


" Cor Ligthert [MVP]"写道:


> Cleo,

服务器应该可以通过其服务器名称访问。而不是Jet
引擎
(访问)及其文件地址。

它实际上比使用Jet更容易。

为什么不先试试这个,做完之后你就可以看到几乎所有的东西都是hapening。
http://www.vb-tips.com/dbpages.aspx?...2-b1ed16424252

我希望这会有所帮助,

Cor

cleo < cl ** @ discussion.microsoft.comschreef in bericht
新闻:C4 ****************************** **** @ microso ft.com ...


>我正在从VB6 / Access迁移到Visual Basic和SQL Express。我已经成功在我的本地机器上编写了测试代码,并且我现在正在设置

测试

for

部署到服务器。我在Windows 2003

工作。


但是,我无法使用VB

Express程序中的连接字符串进行连接。我正在使用带有

属性的SQL连接字符串生成器


Dim cn as SQLClient.DBConnectionStringBuilder = new

SQLClient.DBConnectionStringBuilder

cn.DataSource =" AppServer02 \SQLExpress"

cn.ApplicationName =" VBTest"

cn.AttachDBFilename =" testdb .mdf"

cn.IntegratedSecurity = True

cn.PersistSecurityInfo = False


我收到的错误是

当连接到SQL Server 2005时,这个失败可能是由于在默认设置下SQL Server不允许远程的

事实



连接。


我明白VB Express不支持远程连接

通过



设计师,但我想我可以使用

连接字符串连接到远程数据库。


感谢您的帮助





I am migrating from VB6/Access to Visual Basic and SQL Express. I have
success writing test code on my local machine and am now setting up tests for
deployment to a server. I have installed SQL Express on a Windows 2003
Server. I can connect and create databases on the Remote Server from my
local machine using SQL Management Express, so I know Remote Access is
working.

However, I am unable to connect using a connection string within my VB
Express program. I am using the SQL Connection String Builder with the
properties

Dim cn as SQLClient.DBConnectionStringBuilder = new
SQLClient.DBConnectionStringBuilder
cn.DataSource = "AppServer02\SQLExpress"
cn.ApplicationName = "VBTest"
cn.AttachDBFilename = "testdb.mdf"
cn.IntegratedSecurity = True
cn.PersistSecurityInfo = False

The error I receive is
When connecting to SQL Server 2005, this failure may be caused by the fact
that under the default settings SQL Server does not allow remote connections.

I understand that VB Express does not support Remote Connections through the
Designer, but I thought I could connect to a remote database using a
connection string.

Your help is appreciated

解决方案

Cleo,

The server should be reachable by its Server name. Not as by the Jet engine
(access) with its file address.

It is in fact much easier than with Jet.

Why not try this one first, after doing this you can see almost everything
that is hapening.
http://www.vb-tips.com/dbpages.aspx?...2-b1ed16424252

I hope this helps,

Cor

"cleo" <cl**@discussions.microsoft.comschreef in bericht
news:C4**********************************@microsof t.com...

>I am migrating from VB6/Access to Visual Basic and SQL Express. I have
success writing test code on my local machine and am now setting up tests
for
deployment to a server. I have installed SQL Express on a Windows 2003
Server. I can connect and create databases on the Remote Server from my
local machine using SQL Management Express, so I know Remote Access is
working.

However, I am unable to connect using a connection string within my VB
Express program. I am using the SQL Connection String Builder with the
properties

Dim cn as SQLClient.DBConnectionStringBuilder = new
SQLClient.DBConnectionStringBuilder
cn.DataSource = "AppServer02\SQLExpress"
cn.ApplicationName = "VBTest"
cn.AttachDBFilename = "testdb.mdf"
cn.IntegratedSecurity = True
cn.PersistSecurityInfo = False

The error I receive is
When connecting to SQL Server 2005, this failure may be caused by the fact
that under the default settings SQL Server does not allow remote
connections.

I understand that VB Express does not support Remote Connections through
the
Designer, but I thought I could connect to a remote database using a
connection string.

Your help is appreciated



Thanks for the response
I''m sorry but I can''t access the link you provided. Can you provide me with
some additional information or a different link.
"Cor Ligthert [MVP]" wrote:

Cleo,

The server should be reachable by its Server name. Not as by the Jet engine
(access) with its file address.

It is in fact much easier than with Jet.

Why not try this one first, after doing this you can see almost everything
that is hapening.
http://www.vb-tips.com/dbpages.aspx?...2-b1ed16424252

I hope this helps,

Cor

"cleo" <cl**@discussions.microsoft.comschreef in bericht
news:C4**********************************@microsof t.com...

I am migrating from VB6/Access to Visual Basic and SQL Express. I have
success writing test code on my local machine and am now setting up tests
for
deployment to a server. I have installed SQL Express on a Windows 2003
Server. I can connect and create databases on the Remote Server from my
local machine using SQL Management Express, so I know Remote Access is
working.

However, I am unable to connect using a connection string within my VB
Express program. I am using the SQL Connection String Builder with the
properties

Dim cn as SQLClient.DBConnectionStringBuilder = new
SQLClient.DBConnectionStringBuilder
cn.DataSource = "AppServer02\SQLExpress"
cn.ApplicationName = "VBTest"
cn.AttachDBFilename = "testdb.mdf"
cn.IntegratedSecurity = True
cn.PersistSecurityInfo = False

The error I receive is
When connecting to SQL Server 2005, this failure may be caused by the fact
that under the default settings SQL Server does not allow remote
connections.

I understand that VB Express does not support Remote Connections through
the
Designer, but I thought I could connect to a remote database using a
connection string.

Your help is appreciated




Cleo,

Can you tell me why you cannot access that link?

Because it is the website from Ken and me.

Thanks in advance

Cor

"cleo" <cl**@discussions.microsoft.comschreef in bericht
news:14**********************************@microsof t.com...

Thanks for the response
I''m sorry but I can''t access the link you provided. Can you provide me
with
some additional information or a different link.
"Cor Ligthert [MVP]" wrote:

>Cleo,

The server should be reachable by its Server name. Not as by the Jet
engine
(access) with its file address.

It is in fact much easier than with Jet.

Why not try this one first, after doing this you can see almost
everything
that is hapening.
http://www.vb-tips.com/dbpages.aspx?...2-b1ed16424252

I hope this helps,

Cor

"cleo" <cl**@discussions.microsoft.comschreef in bericht
news:C4**********************************@microso ft.com...

>I am migrating from VB6/Access to Visual Basic and SQL Express. I have
success writing test code on my local machine and am now setting up
tests
for
deployment to a server. I have installed SQL Express on a Windows 2003
Server. I can connect and create databases on the Remote Server from
my
local machine using SQL Management Express, so I know Remote Access is
working.

However, I am unable to connect using a connection string within my VB
Express program. I am using the SQL Connection String Builder with the
properties

Dim cn as SQLClient.DBConnectionStringBuilder = new
SQLClient.DBConnectionStringBuilder
cn.DataSource = "AppServer02\SQLExpress"
cn.ApplicationName = "VBTest"
cn.AttachDBFilename = "testdb.mdf"
cn.IntegratedSecurity = True
cn.PersistSecurityInfo = False

The error I receive is
When connecting to SQL Server 2005, this failure may be caused by the
fact
that under the default settings SQL Server does not allow remote
connections.

I understand that VB Express does not support Remote Connections
through
the
Designer, but I thought I could connect to a remote database using a
connection string.

Your help is appreciated





这篇关于VB Express SQL Express远程连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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