将vb app连接到sql 2005 express [英] connect vb app to sql 2005 express

查看:65
本文介绍了将vb app连接到sql 2005 express的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对sql 2005和VB都很陌生,但请耐心等待。我在Windows 2003 Standard服务器上安装了SQL 2005 Express。我有

也在服务器上安装了VB 2005 Express版。 SQL似乎是运行良好的b $ b(我可以创建数据库,表格,修改它们等等)我已经在VB Express中创建了一个非常基本的应用程序
这只是让我查看和

修改当前表。它在服务器上工作得很好。但是,我试图通过

网络上的XP专业版机器连接这个应用程序,我真的不知道从哪里开始。我尝试运行应用程序


在网络上本地工作,我得到错误26无法连接

到数据库服务器。我读过关于使用字符串和ADO的内容,但我不是很熟悉VB以使其工作。此外,两台机器都在相同的网络上,我可以通过SQL Server管理工作室快速从XP专业机器连接到服务器

。 />

非常感谢任何帮助。

谢谢,

Josh

I''m pretty new to both sql 2005 and VB but please bear with me. I have
installed SQL 2005 express on a Windows 2003 Standard server. I have
also installed VB 2005 Express edition on the server. SQL seems to be
running fine (I can create databases, tables, modify them, etc.) I have

created a very basic app in VB express that just lets me view and
modify the current tables. It works just fine on the server. However, I

am trying to make this app connect from an XP pro machine on the
network and I really don''t know where to start. I tried running the app

that works locally over the network and I get "error 26" can''t connect
to database server. I''ve read about using strings and ADO but I''m not
familiar enough with VB to make it work. Also, both machines are on the

same network and I can connect to the server from the XP pro machine
with SQL server management studio express.

Any help is greatly appreciated.
Thanks,
Josh

推荐答案

除非你发布一些代码,否则有些人很难知道问题是什么。特别是..用于将APP

连接到数据库的代码。

It is kind of hard for someone to know what the problem is unless you
post some of your code. Specially..the code you use to connect your APP
to the Database.




IdleBrain写道:

IdleBrain wrote:

除非你发布一些代码,否则有些人很难知道问题是什么。特别是..用于将APP

连接到数据库的代码。
It is kind of hard for someone to know what the problem is unless you
post some of your code. Specially..the code you use to connect your APP
to the Database.




这是我正在尝试连接字符串。当主表单加载时,它应该运行


Dim conn As New SqlConnection()

conn.ConnectionString =" Data

Source = MYSERVER \ SQLEXPRESS; AttachDbFilename = | DataD irectory | \ testdatabase.mdf; Integrated

Security = True; User Instance = false"


调试应用程序时出现此错误:


键''attachdbfilename'的值无效



here is what i am trying for the connection string. It is supposed to
run when the main form loads.
Dim conn As New SqlConnection()
conn.ConnectionString = "Data
Source=MYSERVER\SQLEXPRESS;AttachDbFilename=|DataD irectory|\testdatabase.mdf;Integrated
Security=True;User Instance=false"

I get this error when I debug the application:

Invalid value for key ''attachdbfilename''




尝试:


" server = MYSERVER \ SQLEXPRESS;初始目录= testdatabase;集成

security = True"

Try:

"server=MYSERVER\SQLEXPRESS;initial catalog=testdatabase;integrated
security=True"


这篇关于将vb app连接到sql 2005 express的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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