473,473 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Real basic problem. Can't open a SQL connection

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
5 1521
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
0
by: Jim S. | last post by:
I'm having a horrible time simply inserting the date in a MySQL database through a Visual Basic program. I have a table, called "ORDERS"; "ID" is the primary key. I'm trying the insert the date,...
2
by: InvisibleMan | last post by:
Hi, I feel a little dumb for asking this (considering im writing TSQL) but there doesn't seem to be any definitive answers on the search engines... Okay I understand that if you open the ADO...
4
by: Familjen Karlsson | last post by:
How will the code under look like in Visual Basic .Net, since you can't use the keyword null anymoore in Visual Basic .Net. What can I use instead. SqlConnection connection = null; SqlCommand...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.