How to connect to database

G

Guest

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?
 
C

Cor Ligthert [MVP]

Noob,

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

Cor
 
C

Cerebrus

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.
 
C

Cor Ligthert [MVP]

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
 
N

noob

Cerebrus said:
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:
Thanks Cerebrus & Cor
Changing it to AttachDbFilename corrected the problem.
 
G

Guest

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?
 
R

raibeart

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top