Home All Groups Group Topic Archive Search About

How to connect to database

Author
7 Jun 2006 2:09 AM
noob
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

Author
7 Jun 2006 6:19 AM
Cor Ligthert [MVP]
Noob,

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

Cor

<noob> schreef in bericht
Show quoteHide quote
news:44863576$0$26864$88260bb3@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
>
Author
7 Jun 2006 11:32 AM
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.

Cor Ligthert [MVP] wrote:

Show quoteHide quote
> Noob,
>
> You can try to make a connectionstring included in the Data tab.
>
> Cor
>
> <noob> schreef in bericht
> news:44863576$0$26864$88260bb3@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
> >
Author
7 Jun 2006 12:40 PM
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



Show quoteHide quote
"Cerebrus" <zorg***@sify.com> schreef in bericht
news:1149679943.121665.187150@i39g2000cwa.googlegroups.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:44863576$0$26864$88260bb3@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
>> >
>
Author
7 Jun 2006 10:55 PM
noob
Cerebrus wrote:
Show quoteHide quote
> 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:44863576$0$26864$88260bb3@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.
Author
8 Jun 2006 12:43 AM
Dennis
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


Show quoteHide quote
"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:44863576$0$26864$88260bb3@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
> > >
>
>
Author
8 Jun 2006 8:54 PM
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

Dennis wrote:
Show quoteHide quote
> 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