By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,631 Members | 892 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,631 IT Pros & Developers. It's quick & easy.

Real basic problem. Can't open a SQL connection

P: n/a
Hi,

I am trying to go from VB to ASP. The following code works perfectly in VB.

Dim cn as New SqlConnection
Dim sConnect as String = "workstation id=VECTRA\mh;data
source=VECTRA;Initial Catalog=Items; Integrated Security=SSPI"
cn.ConnectionString=sConnect
cn.Open()

When I past the same code into ASP.NET, I get this error:

Login failed for user 'VECTRA\ASPNET'.

Can someone help me?

Thanks,

Michael
Nov 18 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Recreate your connstring
http://www.darkfalz.com/1059
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Michael Hesse" <mh****@sbcglobal.net> wrote in message
news:aL****************@newssvr21.news.prodigy.com ...
Hi,

I am trying to go from VB to ASP. The following code works perfectly in
VB.

Dim cn as New SqlConnection
Dim sConnect as String = "workstation id=VECTRA\mh;data
source=VECTRA;Initial Catalog=Items; Integrated Security=SSPI"
cn.ConnectionString=sConnect
cn.Open()

When I past the same code into ASP.NET, I get this error:

Login failed for user 'VECTRA\ASPNET'.

Can someone help me?

Thanks,

Michael

Nov 18 '05 #2

P: n/a
The message says that login failed for 'VECTRA\ASPNET' .

This means that ASPNET on machine VECTRA does not have rights to the
database. So you need to give it rights.

"Michael Hesse" <mh****@sbcglobal.net> wrote in message
news:aL****************@newssvr21.news.prodigy.com ...
Hi,

I am trying to go from VB to ASP. The following code works perfectly in VB.
Dim cn as New SqlConnection
Dim sConnect as String = "workstation id=VECTRA\mh;data
source=VECTRA;Initial Catalog=Items; Integrated Security=SSPI"
cn.ConnectionString=sConnect
cn.Open()

When I past the same code into ASP.NET, I get this error:

Login failed for user 'VECTRA\ASPNET'.

Can someone help me?

Thanks,

Michael

Nov 18 '05 #3

P: n/a
I didn't realize I needed to create a special user for ASP.Net.

Thanks so much.

Michael
"Marina" <so*****@nospam.com> wrote in message
news:OM***************@TK2MSFTNGP11.phx.gbl...
The message says that login failed for 'VECTRA\ASPNET' .

This means that ASPNET on machine VECTRA does not have rights to the
database. So you need to give it rights.

"Michael Hesse" <mh****@sbcglobal.net> wrote in message
news:aL****************@newssvr21.news.prodigy.com ...
Hi,

I am trying to go from VB to ASP. The following code works perfectly in

VB.

Dim cn as New SqlConnection
Dim sConnect as String = "workstation id=VECTRA\mh;data
source=VECTRA;Initial Catalog=Items; Integrated Security=SSPI"
cn.ConnectionString=sConnect
cn.Open()

When I past the same code into ASP.NET, I get this error:

Login failed for user 'VECTRA\ASPNET'.

Can someone help me?

Thanks,

Michael


Nov 18 '05 #4

P: n/a
Hi Curt,

Thanks for responding.

Apparently the connection string wasn't the problem, but I would still like to understand your suggestion.

Title: Connection Strings
Comments: Here is a simple/easy way to create a connection string to your databases when you can't quite remember the syntax.
Code: Step 1:
Open a folder on your hard drive, any folder will do.

What do I open it with? With the Windows Explorer? From within the .NET IPE?

When I try both of these, double-clicking just opens the file in Notepad.

Could you give me a bit more information? Thanks.

Michael


"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message news:Om**************@TK2MSFTNGP11.phx.gbl...
Recreate your connstring
http://www.darkfalz.com/1059


--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


Nov 18 '05 #5

P: n/a
Title: Connection Strings
Comments: Here is a simple/easy way to create a connection string to
your databases when you can't quite remember the syntax.
Code: Step 1:
Open a folder on your hard drive, any folder will do.

What do I open it with? With the Windows Explorer? From within the
..NET IPE?
-- Windows Explorer

When I try both of these, double-clicking just opens the file in
Notepad.
-- make sure the file is a .UDL, not a .UDL.TXT

Could you give me a bit more information? Thanks.
-- basically all it does is step you through creating a connection string.
You can get more info like this from www.aspfaq.com and even
www.connectionstrings.com

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com

Nov 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.