473,323 Members | 1,570 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,323 software developers and data experts.

Weird SQL Connection String problem?

I am connecting to my SQL database using following connection string

Dim strSQL = "Persist Security Info=False;Integrated
Security=False;database=myDA;server=myServerNane;U ser ID=;Password="
Dim conn As New SqlConnection(strSQL)

conn.Open()
conn.Close()

The above code works fine, even if User ID and password are blank? How is it
possible?

Nov 22 '05 #1
4 1297
On Tue, 5 Oct 2004 06:29:03 -0700, Job Lot wrote:
I am connecting to my SQL database using following connection string

Dim strSQL = "Persist Security Info=False;Integrated
Security=False;database=myDA;server=myServerNane;U ser ID=;Password="
Dim conn As New SqlConnection(strSQL)

conn.Open()
conn.Close()

The above code works fine, even if User ID and password are blank? How is it
possible?


Perhaps it's defaulting to a trusted connection or your SQL Server is set
to allow Windows authentication?

Just a guess.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 22 '05 #2
Hi Job,

You use the integrated Sql Security to connect (no windows authentication)
and I assume the Sql Server has a guest account enabled (anonymous). You
may be able to connect, but the guest account quite often has no database
access rights.

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 22 '05 #3
If you don't actually perform a SQL Command in between the Open and the
Close, you would never know.

ADO will not actually attempt to acquire a connection object until you need
one. From the code you posted below, you don't need one.

Put in a command object to do something trivial. Then your connection
string will be validated.

--- Nick

"Job Lot" <Jo****@discussions.microsoft.com> wrote in message
news:A9**********************************@microsof t.com...
I am connecting to my SQL database using following connection string

Dim strSQL = "Persist Security Info=False;Integrated
Security=False;database=myDA;server=myServerNane;U ser ID=;Password="
Dim conn As New SqlConnection(strSQL)

conn.Open()
conn.Close()

The above code works fine, even if User ID and password are blank? How is it possible?

Nov 22 '05 #4
Hi Job,

You use the integrated Sql Security to connect (no windows authentication)
and I assume the Sql Server has a guest account enabled (anonymous). You
may be able to connect, but the guest account quite often has no database
access rights.

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 22 '05 #5

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

Similar topics

3
by: Job Lot | last post by:
I am connecting to my SQL database using following connection string Dim strSQL = "Persist Security Info=False;Integrated Security=False;database=myDA;server=myServerNane;User ID=;Password=" Dim...
0
by: Andrew Mayo | last post by:
This problem was discovered with MSDE2000 SP2 and under WinXP SP2. We are unsure whether it is more widespread as it has only been seen on one machine to date. The problem is related to name...
5
by: crunix | last post by:
Hello. I have developed a medical application with php 4 linked to IBM DB2 database. The database connection is right and i can access data with no problem...but sometimes when i reload the...
0
by: I am Sam | last post by:
Ok whats wrong with my toolbar? When I debug I don't get an error message and the databinding is working correctly but the toolbar itself and the <iewc:ToolbarDropDownlist /> control isn't showing...
2
by: Cc | last post by:
hi, while I making my own class library using odbc.net I encounter strange problem in this class Public Sub New() ' some code doing openning connection end sub
1
by: Gerald Stampfel | last post by:
Hi, i am doing ajax requests to an IIS server. the response is a JSON string, stored in xml.responseText. in IE everything is fine. in firefox, only a part (80%) of the string is delievered in 8...
7
by: =?Utf-8?B?VGhlIE1hbiBGcm9tIFNRTA==?= | last post by:
I'm having the darndest problem and I can't seem to recreate it anywhere, and I'm looking for someone with a little insight. I've created a custom EmailTraceListener which implements the...
3
by: Harry Strybos | last post by:
Hi All I have a really strange problem occurring in my application. When I read in the application settings for connection strings the following happens: Here are my connection string settings...
5
by: Gangreen | last post by:
I'm trying to send bytes to a server, but I always get an exception at the send command saying: the socket should not be connected (line 26 in the code below). This is weird right? cause I don't...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.