473,396 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to connect to database

I created a database using vb express 2005 and now am trying to access it using a sql connection.
Here is the connection string:
ConnString = "Data Source= .\SQLEXPRESS;Initial Catalog = |Data Directory|\trail-db.mdf;Integrated Security=SSPI;Persist Security Info=True;"

When I try to debug, it gives a sqlexception error saying it cant open the database due to login failure. I thought using SSPI would force it into windows authentication but I am doing something wrong. Can anyone help?


--
Posted via a free Usenet account from http://www.teranews.com

Jun 7 '06 #1
6 1244
Noob,

You can try to make a connectionstring included in the Data tab.

Cor

<noob> schreef in bericht
news:44***********************@free.teranews.com.. .
I created a database using vb express 2005 and now am trying to access it
using a sql connection.
Here is the connection string:
ConnString = "Data Source= .\SQLEXPRESS;Initial Catalog = |Data
Directory|\trail-db.mdf;Integrated Security=SSPI;Persist Security
Info=True;"

When I try to debug, it gives a sqlexception error saying it cant open the
database due to login failure. I thought using SSPI would force it into
windows authentication but I am doing something wrong. Can anyone help?


--
Posted via a free Usenet account from http://www.teranews.com

Jun 7 '06 #2
Shouldn't the connection string have been something like :

ConnString = "Data Source= .\SQLEXPRESS; AttachDbFilename=|Data
Directory|\trail-db.mdf; Initial Catalog=<MyDatabase>; Integrated
Security=True;Persist Security Info=True;"

Regards,

Cerebrus.

Cor Ligthert [MVP] wrote:
Noob,

You can try to make a connectionstring included in the Data tab.

Cor

<noob> schreef in bericht
news:44***********************@free.teranews.com.. .
I created a database using vb express 2005 and now am trying to access it
using a sql connection.
Here is the connection string:
ConnString = "Data Source= .\SQLEXPRESS;Initial Catalog = |Data
Directory|\trail-db.mdf;Integrated Security=SSPI;Persist Security
Info=True;"

When I try to debug, it gives a sqlexception error saying it cant open the
database due to login failure. I thought using SSPI would force it into
windows authentication but I am doing something wrong. Can anyone help?


--
Posted via a free Usenet account from http://www.teranews.com


Jun 7 '06 #3
Cerebrus

Can be but this can even be more than enough, but this can in my idea not be
the problem.

"Server=.\SQLExpress; DataBase=HKW; Integrated Security=SSPI"
Cor

"Cerebrus" <zo*****@sify.com> schreef in bericht
news:11**********************@i39g2000cwa.googlegr oups.com...
Shouldn't the connection string have been something like :

ConnString = "Data Source= .\SQLEXPRESS; AttachDbFilename=|Data
Directory|\trail-db.mdf; Initial Catalog=<MyDatabase>; Integrated
Security=True;Persist Security Info=True;"

Regards,

Cerebrus.

Cor Ligthert [MVP] wrote:
Noob,

You can try to make a connectionstring included in the Data tab.

Cor

<noob> schreef in bericht
news:44***********************@free.teranews.com.. .
>I created a database using vb express 2005 and now am trying to access
>it
>using a sql connection.
> Here is the connection string:
> ConnString = "Data Source= .\SQLEXPRESS;Initial Catalog = |Data
> Directory|\trail-db.mdf;Integrated Security=SSPI;Persist Security
> Info=True;"
>
> When I try to debug, it gives a sqlexception error saying it cant open
> the
> database due to login failure. I thought using SSPI would force it into
> windows authentication but I am doing something wrong. Can anyone help?
>
>
>
>
> --
> Posted via a free Usenet account from http://www.teranews.com
>

Jun 7 '06 #4
Cerebrus wrote:
Shouldn't the connection string have been something like :

ConnString = "Data Source= .\SQLEXPRESS; AttachDbFilename=|Data
Directory|\trail-db.mdf; Initial Catalog=<MyDatabase>; Integrated
Security=True;Persist Security Info=True;"

Regards,

Cerebrus.

Cor Ligthert [MVP] wrote:

Noob,

You can try to make a connectionstring included in the Data tab.

Cor

<noob> schreef in bericht
news:44***********************@free.teranews.com ...
I created a database using vb express 2005 and now am trying to access it
using a sql connection.
Here is the connection string:
ConnString = "Data Source= .\SQLEXPRESS;Initial Catalog = |Data
Directory|\trail-db.mdf;Integrated Security=SSPI;Persist Security
Info=True;"

When I try to debug, it gives a sqlexception error saying it cant open the
database due to login failure. I thought using SSPI would force it into
windows authentication but I am doing something wrong. Can anyone help?


--
Posted via a free Usenet account from http://www.teranews.com


Thanks Cerebrus & Cor
Changing it to AttachDbFilename corrected the problem.
Jun 7 '06 #5
Kinda off topic but if I develop an application that uses SQL Express
database's, then any user's machine trying to run the applicaiton must also
have SQL Express installed to run...is this correct?
--
Dennis in Houston
"Cerebrus" wrote:
Shouldn't the connection string have been something like :

ConnString = "Data Source= .\SQLEXPRESS; AttachDbFilename=|Data
Directory|\trail-db.mdf; Initial Catalog=<MyDatabase>; Integrated
Security=True;Persist Security Info=True;"

Regards,

Cerebrus.

Cor Ligthert [MVP] wrote:
Noob,

You can try to make a connectionstring included in the Data tab.

Cor

<noob> schreef in bericht
news:44***********************@free.teranews.com.. .
I created a database using vb express 2005 and now am trying to access it
using a sql connection.
Here is the connection string:
ConnString = "Data Source= .\SQLEXPRESS;Initial Catalog = |Data
Directory|\trail-db.mdf;Integrated Security=SSPI;Persist Security
Info=True;"

When I try to debug, it gives a sqlexception error saying it cant open the
database due to login failure. I thought using SSPI would force it into
windows authentication but I am doing something wrong. Can anyone help?


--
Posted via a free Usenet account from http://www.teranews.com


Jun 8 '06 #6
No, it has to be installed on one users machine or on a machine all the
users can get to.

BTW, I am the Access Developer's Workshop SIG leader at HAL-PC. We are
holding a hands-on lab for SQL Express this Saturday from 9 am - noon.
You are invited to attend. Check www.hal-pc.org for directions.

Robert also in Houston

Dennis wrote:
Kinda off topic but if I develop an application that uses SQL Express
database's, then any user's machine trying to run the applicaiton must also
have SQL Express installed to run...is this correct?
--
Dennis in Houston


Jun 8 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Mr Dygi | last post by:
Hi, PHP 4.3.4 installed manually from package *.zip and Apache 2. I have a problem with this simple code: <?php $link = mysql_connect("127.0.0.1","","") or die("Could not connect: " ....
1
by: DAVID | last post by:
Hello, With regards to the Connect dialog on Oracle forms 6i via which we can connect to Oracle database, should we use the same functionality on forms run time again? I mean, I want to make a...
3
by: Lee | last post by:
Hi, I'm developing a socket program to connect to Informix database through the ODBC. In here i called my socket program as "tap" . My tap will listen for data from unix through port 1070. After...
4
by: Scott Holland | last post by:
HELP - Need to connect to DB2 database on AIX from NT server. Also AS/400 from NT Server -- I am experienced in ORACLE and a novice at DB2. What tools would be the equivalent of Net*8 or...
4
by: banz | last post by:
Hello I have a problem to resolve: I wrote a Perlscript which caches data from a server (local on my machine) I would like to have a other connection to a remote server but I don't know how to...
3
by: Jassim Rahma | last post by:
I would like to know what is the best way to onnect to connect to a database in general which provides you with full functionality & fast access? Best Regards, Jassim Rahma *** Sent via...
1
by: GNoter | last post by:
Scenario: I've a WebFarm with 2 web servers which are NLBs (network load balanced). Web1 and Web2; they are not part of a domain. I have a third server, Server3, which is part of a domain and on...
21
by: Steve | last post by:
I moved my database from one server to another SQL server. I did a backup and restore of the database. I can connect to the database on server A from my asp.net app but when I try to connect to my...
2
by: jeffhan | last post by:
we have os/400 db2 database at the backend. i installed db2 v9 connect server on one windows server which is locating the same network with database server. now how to i configure the connect...
5
by: danfan46 | last post by:
Hi! I have a previous post on the subject that connect takes a long time. I uninstalled db2 completely. Installed V9.5 Installed fixpack 1 created das created an instance installed...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.