473,378 Members | 1,390 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,378 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 1302
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...
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...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.