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

Can't connect to SQL 2005

Bob
Hello folks,

I am tring to create a connection to a SQL Server 2005 database but
cannot. I get an error messahe that

SQL Server does not exist or access denied

I have tried Windows Authentication and I have tried SQL Server
Authentication.

I have tried numerous connection strings...so I don't think it is the
connection string.

I must be missing something obvious....or something
dumb....interesting it is that I can connect using ado and Microsoft
Access.

Anybody got any ideas?

Regards,

Bob Sweeney

Mar 2 '07 #1
4 3926
Bob wrote:
Hello folks,

I am tring to create a connection to a SQL Server 2005 database but
cannot. I get an error messahe that

SQL Server does not exist or access denied

I have tried Windows Authentication and I have tried SQL Server
Authentication.

I have tried numerous connection strings...so I don't think it is the
connection string.

I must be missing something obvious....or something
dumb....interesting it is that I can connect using ado and Microsoft
Access.

Anybody got any ideas?

Regards,

Bob Sweeney
Try something like this. Seems to work fine for me, dont forget to check the
ports in firewalled connections to allow 1433.....

public static void NewSQLConnection()
{
//Gets the location of the SQL database server.
string datasource = ApplicationSettings.MeetySettings.DNS + "\\"
+ ApplicationSettings.MeetySettings.Instance;
//Builds a connection string to connect to the database.
string connectionString = "user id=" +
ApplicationSettings.MeetySettings.Username +
"; pwd=" + ApplicationSettings.MeetySettings.Password +
"; Initial Catalog=" +
ApplicationSettings.MeetySettings.TableName +
"; Data Source=" + datasource +
";Packet Size=4096" +
";Connection Timeout=15;";

//Creates a new instanse of SqlConnection using the connection
settings above.
ApplicationSettings.MeetySettings.SQLConnection = new
SqlConnection(connectionString);
//Keep a record of the amount of data the connection is
transfering
ApplicationSettings.MeetySettings.SQLConnection.St atisticsEnabled
= true;
}
--
Regards JJ (UWA)

Mar 2 '07 #2
PS

"Bob" <Go****@Yahoo.Comwrote in message
news:11**********************@30g2000cwc.googlegro ups.com...
Hello folks,

I am tring to create a connection to a SQL Server 2005 database but
cannot. I get an error messahe that

SQL Server does not exist or access denied

I have tried Windows Authentication and I have tried SQL Server
Authentication.

I have tried numerous connection strings...so I don't think it is the
connection string.

I must be missing something obvious....or something
dumb....interesting it is that I can connect using ado and Microsoft
Access.

Anybody got any ideas?
Is SqlBrowser service running?

Otherwise post some code.

PS
>
Regards,

Bob Sweeney

Mar 2 '07 #3
Hi,

"Bob" <Go****@Yahoo.Comwrote in message
news:11**********************@30g2000cwc.googlegro ups.com...
Hello folks,

I am tring to create a connection to a SQL Server 2005 database but
cannot. I get an error messahe that

SQL Server does not exist or access denied
The error is self explanatory, check these:
1- You have the correct server name
2- You have the correct user/password
3- There is no a firewall in between the client & the server


Mar 2 '07 #4
Nik
You might also want to look at the "SQL Server 2005 Surface Area
Configuration". Looking in the tree:

- MSSQLSERVER -Database Engine -Remote Connections

(Where MSSQLSERVER might be a different Instance name)

You have options for "Local connections only" vs "Local and remote
connections". Your code may be trying to access SQL Server by a remote
path where ADO and Access are using a Local path.

Or something.

Nik

Bob wrote:
Hello folks,

I am tring to create a connection to a SQL Server 2005 database but
cannot. I get an error messahe that

SQL Server does not exist or access denied

I have tried Windows Authentication and I have tried SQL Server
Authentication.

I have tried numerous connection strings...so I don't think it is the
connection string.

I must be missing something obvious....or something
dumb....interesting it is that I can connect using ado and Microsoft
Access.

Anybody got any ideas?

Regards,

Bob Sweeney
Mar 3 '07 #5

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

Similar topics

1
by: lourivalsjr | last post by:
Hi, i have SQL 2000 and 2005 on same machine(with different intance names, of course), my laptop - XP with SP2. The 2005 works fine but i can't connect on SQL 2000. All the the SQL services are...
14
by: Marcus | last post by:
I have a function that simply returns TRUE if it can connect to a particular Sql Server 2005 express, or FALSE if it cannot. I am getting some strange error codes returned when the computer that...
0
by: Larry Rebich | last post by:
I am trying to use the sample web template that is distributed with Visual Studio 2005 called 'Personal Web Site Starter Kit'. After running for awhile it fails with the following message: ...
5
by: Jack | last post by:
Hello, I had SQL2000 server running fine on the windows 2003 box. I then installed SQL 2005 Express. They both worked together fine. I then uninstalled SQL 2005 Express and installed SQL 2005...
2
by: cheer | last post by:
HI,there I use the VS 2005 EXPRESSION VERSION to develop and the database is SQL 2005 . Especially ,it is not the SQL 2005 expression version . I can not find the data connect for SQL 2005 ......
9
by: Gabriel | last post by:
Hello, I installed SQL server 2005 SP1 on a Windows XP SP2 From Visual Studio, I'm trygin to create a connection to a database, but I receive this error but I'm creating the connection (I...
9
by: =?Utf-8?B?RnJpdHo=?= | last post by:
Hi all, I am having the following problems in getting Microsoft Visual Studio 2005 Professional to link to an Access .mdb database. Please help me to sort this out. Problem 1: ======= The...
6
by: Zvonko Bičkup | last post by:
Hi! I am trying to connect to my SqlServer 2005 thru internet, but it is not working. I have a dyndns updater on my server which tells me an ip address of the router. The router is configured to...
7
by: RN1 | last post by:
Is it possible to connect to my local SQL Server 2005 database from a remote web server? If yes, what ConnectionString do I use? Thanks, Ron
2
by: varunkumarid | last post by:
Hai to all, i am new to VB.net 2005, I have difficult to connect the SQL server 2000 to VB.net 2005... If You know how to connect the SQL 2000 and VB.net 2005,please Insist to me Quickly....
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.