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

oleDBConnection not recognizing Database

P: n/a
Hi,
I'm using oleDBConnection to connect to SQL server. I keep getting "SQL
Server does not exist" on Open event.
The code I'm using is the following
Dim objConn As New OleDbConnection("Provider=SQLOLEDB;Data
Source=sqlserver;Database=db;User Id=user;Password=user;")
Can anyone help?

Roger

--
Axiom Software, Ltd.
400 Columbus Ave
Valhalla, NY 10595
(914) 769-8800
Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
My Data Source is a machine name. SQL server uses SQL Server and Windows
authentication.


"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
The actual message is "SQL Does not exist or access is denied." It could be one or the other. First, your "Data Source" declaration - Is that a machine name there? It has to be either a machine name, domain name, or an IP
address of the machine hosting the SQL Server. Is it? If so, what
authentication method is the server using?

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
The more I learn, the less I know.

"Roger Cantillo" <ro****@axiomsw.com> wrote in message
news:ee**************@TK2MSFTNGP11.phx.gbl...
Hi,
I'm using oleDBConnection to connect to SQL server. I keep getting "SQL
Server does not exist" on Open event.
The code I'm using is the following
Dim objConn As New OleDbConnection("Provider=SQLOLEDB;Data
Source=sqlserver;Database=db;User Id=user;Password=user;")
Can anyone help?

Roger

--
Axiom Software, Ltd.
400 Columbus Ave
Valhalla, NY 10595
(914) 769-8800


Nov 17 '05 #2

P: n/a
Try substituting "Initial Catalog" for "Database" in your Connection String.
Example:

"Provider=sqloledb;Data Source=MachineName;Initial Catalog=Databasename;User
Id=UserName;Password=UserPassword;"

If that doesn't work, one of a couple of things could be wrong:

1. The machine name is not recognized across the network. Try using an IP
address instead. And make sure that the SQL Server is using TCP/IP
2. Your User Name and/or Password are incorrectly typed
3. Your UserName account doesn't have permission to access the database

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
The more I learn, the less I know.

"Roger Cantillo" <ro****@axiomsw.com> wrote in message
news:ev**************@TK2MSFTNGP11.phx.gbl...
My Data Source is a machine name. SQL server uses SQL Server and Windows
authentication.


"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
The actual message is "SQL Does not exist or access is denied." It could

be
one or the other. First, your "Data Source" declaration - Is that a

machine
name there? It has to be either a machine name, domain name, or an IP
address of the machine hosting the SQL Server. Is it? If so, what
authentication method is the server using?

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
The more I learn, the less I know.

"Roger Cantillo" <ro****@axiomsw.com> wrote in message
news:ee**************@TK2MSFTNGP11.phx.gbl...
Hi,
I'm using oleDBConnection to connect to SQL server. I keep getting "SQL Server does not exist" on Open event.
The code I'm using is the following
Dim objConn As New OleDbConnection("Provider=SQLOLEDB;Data
Source=sqlserver;Database=db;User Id=user;Password=user;")
Can anyone help?

Roger

--
Axiom Software, Ltd.
400 Columbus Ave
Valhalla, NY 10595
(914) 769-8800



Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.