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

oleDBConnection not recognizing Database

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

Similar topics

5
by: Tim Bücker | last post by:
Hello. I am trying to get a connection to MySQL using OleDb but it seems that I am making something wrong. I´ve found this source in the net but it doesn´t work for me: ...
1
by: Matthias Kwiedor | last post by:
Hello! My Application is Multi-Threaded, where i have several threads which get datas and write them to the database, or have to read from the database to compare the datas and make updates if...
2
by: Grant | last post by:
My C# web application connects to an Access database using the OleDbConnection and OleDbDataReader. I have 3 other computers that connect to this server but very frequently I get an 'Unspecified...
1
by: Keith | last post by:
Hi, if have this method in a cs file that connections to a database and returns a datareader to my web form. public OleDbDataReader GetDataReader(string theSQL) { theConn = new...
3
by: Ludvig | last post by:
This Exception is executed when using SQLConnection. OleDbConnection connects fine. System.EnterpriseServices.Platform.Initialize() +503...
6
by: Bob Achgill | last post by:
I would like to set the DataSource path on my Oledbconnection so that the Windows application will always look in the place where the binary is stored when it looks for the Access database file. ...
5
by: David A. Osborn | last post by:
Is there a way to make the OLEDBConnection to my Access file relative to the path of the executable of the file? I work on the program on a lot of different computers and I am tired of having to...
0
by: Tony Johansson | last post by:
Hello! We have a database and several forms that access the database. When we access the database from all the different forms we only want to have one OleDbConnection that all the forms use. I...
1
by: thulaseeram | last post by:
hi, i am using the following code for uploading <div id="iframe" name="iframe" style="width:850px; height:120px;"> <iframe name="attach_frame" id="attach_frame"...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.