473,395 Members | 1,641 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.

Error: SQL Server does not exist or access denied

Ben
Hi

I am updating a project from Access to run on our SQL Server DB. Currently
I am struggling to connect to the database. I have this code which is
throwing this error: SQL Server does not exist or access denied.

Dim mydataadapter As New SqlDataAdapter
mydataadapter.SelectCommand = New SqlCommand(strSQL)

mydataadapter.SelectCommand.Connection = New SqlConnection("Data
Source=servername\databasename;User ID=domain\username")

mydataadapter.Fill(myDataSet, "tblClient.Client_ID")

myDataGrid.DataSource = myDataSet.Table("tblClient.Client_ID")

myDataGrid.DataBind()

Any ideas

Thanks B
Nov 18 '05 #1
5 2776
See a site such as http://www.connectionstrings.com/ for valid strings.
Basically :
Data Source is the server name, the database name goes in Initial Catalog.

AFAIK when using a Windows account, you just turn "intergrated security" on.
You can only connect using the currently used Windows account...

Patrice

--

"Ben" <Be*@NoSpam.com> a écrit dans le message de
news:uH**************@TK2MSFTNGP10.phx.gbl...
Hi

I am updating a project from Access to run on our SQL Server DB. Currently I am struggling to connect to the database. I have this code which is
throwing this error: SQL Server does not exist or access denied.

Dim mydataadapter As New SqlDataAdapter
mydataadapter.SelectCommand = New SqlCommand(strSQL)

mydataadapter.SelectCommand.Connection = New SqlConnection("Data
Source=servername\databasename;User ID=domain\username")

mydataadapter.Fill(myDataSet, "tblClient.Client_ID")

myDataGrid.DataSource = myDataSet.Table("tblClient.Client_ID")

myDataGrid.DataBind()

Any ideas

Thanks B

Nov 18 '05 #2
Ben
Hi

I was origionally using this connection string:

mydataadapter.SelectCommand.Connection = New SqlConnection("Data
Source=server;Initial Catalog=database;Integrated Security=SSPI;")

Which throws this error - Login failed for user '(null)'. Reason: Not
associated with a trusted SQL Server connection.
"Patrice" <no****@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
See a site such as http://www.connectionstrings.com/ for valid strings.
Basically :
Data Source is the server name, the database name goes in Initial Catalog.

AFAIK when using a Windows account, you just turn "intergrated security" on. You can only connect using the currently used Windows account...

Patrice

--

"Ben" <Be*@NoSpam.com> a écrit dans le message de
news:uH**************@TK2MSFTNGP10.phx.gbl...
Hi

I am updating a project from Access to run on our SQL Server DB.

Currently
I am struggling to connect to the database. I have this code which is
throwing this error: SQL Server does not exist or access denied.

Dim mydataadapter As New SqlDataAdapter
mydataadapter.SelectCommand = New SqlCommand(strSQL)

mydataadapter.SelectCommand.Connection = New SqlConnection("Data
Source=servername\databasename;User ID=domain\username")

mydataadapter.Fill(myDataSet, "tblClient.Client_ID")

myDataGrid.DataSource = myDataSet.Table("tblClient.Client_ID")

myDataGrid.DataBind()

Any ideas

Thanks B


Nov 18 '05 #3
See :
http://support.microsoft.com/default...b;EN-US;316989

(AFAIK the account is ASPNET not APSNET_WP a stated in this KB article)

Patrice

--

"Ben" <Be*@NoSpam.com> a écrit dans le message de
news:uR**************@TK2MSFTNGP11.phx.gbl...
Hi

I was origionally using this connection string:

mydataadapter.SelectCommand.Connection = New SqlConnection("Data
Source=server;Initial Catalog=database;Integrated Security=SSPI;")

Which throws this error - Login failed for user '(null)'. Reason: Not
associated with a trusted SQL Server connection.
"Patrice" <no****@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
See a site such as http://www.connectionstrings.com/ for valid strings.
Basically :
Data Source is the server name, the database name goes in Initial Catalog.
AFAIK when using a Windows account, you just turn "intergrated security"

on.
You can only connect using the currently used Windows account...

Patrice

--

"Ben" <Be*@NoSpam.com> a écrit dans le message de
news:uH**************@TK2MSFTNGP10.phx.gbl...
Hi

I am updating a project from Access to run on our SQL Server DB.

Currently
I am struggling to connect to the database. I have this code which is
throwing this error: SQL Server does not exist or access denied.

Dim mydataadapter As New SqlDataAdapter
mydataadapter.SelectCommand = New SqlCommand(strSQL)

mydataadapter.SelectCommand.Connection = New SqlConnection("Data
Source=servername\databasename;User ID=domain\username")

mydataadapter.Fill(myDataSet, "tblClient.Client_ID")

myDataGrid.DataSource = myDataSet.Table("tblClient.Client_ID")

myDataGrid.DataBind()

Any ideas

Thanks B



Nov 18 '05 #4
Did you check out http://www.connectionstrings.com as recommended?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Ben" <Be*@NoSpam.com> wrote in message
news:uR**************@TK2MSFTNGP11.phx.gbl...
Hi

I was origionally using this connection string:

mydataadapter.SelectCommand.Connection = New SqlConnection("Data
Source=server;Initial Catalog=database;Integrated Security=SSPI;")

Which throws this error - Login failed for user '(null)'. Reason: Not
associated with a trusted SQL Server connection.
"Patrice" <no****@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
See a site such as http://www.connectionstrings.com/ for valid strings.
Basically :
Data Source is the server name, the database name goes in Initial Catalog.
AFAIK when using a Windows account, you just turn "intergrated security"

on.
You can only connect using the currently used Windows account...

Patrice

--

"Ben" <Be*@NoSpam.com> a écrit dans le message de
news:uH**************@TK2MSFTNGP10.phx.gbl...
Hi

I am updating a project from Access to run on our SQL Server DB.

Currently
I am struggling to connect to the database. I have this code which is
throwing this error: SQL Server does not exist or access denied.

Dim mydataadapter As New SqlDataAdapter
mydataadapter.SelectCommand = New SqlCommand(strSQL)

mydataadapter.SelectCommand.Connection = New SqlConnection("Data
Source=servername\databasename;User ID=domain\username")

mydataadapter.Fill(myDataSet, "tblClient.Client_ID")

myDataGrid.DataSource = myDataSet.Table("tblClient.Client_ID")

myDataGrid.DataBind()

Any ideas

Thanks B



Nov 18 '05 #5
Ben
All sorted now - re this link
http://idunno.org/dotNet/trustedConnections.aspx

Thanks B

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:ez**************@TK2MSFTNGP10.phx.gbl...
Did you check out http://www.connectionstrings.com as recommended?

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Ben" <Be*@NoSpam.com> wrote in message
news:uR**************@TK2MSFTNGP11.phx.gbl...
Hi

I was origionally using this connection string:

mydataadapter.SelectCommand.Connection = New SqlConnection("Data
Source=server;Initial Catalog=database;Integrated Security=SSPI;")

Which throws this error - Login failed for user '(null)'. Reason: Not
associated with a trusted SQL Server connection.
"Patrice" <no****@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
See a site such as http://www.connectionstrings.com/ for valid strings. Basically :
Data Source is the server name, the database name goes in Initial Catalog.
AFAIK when using a Windows account, you just turn "intergrated security"
on.
You can only connect using the currently used Windows account...

Patrice

--

"Ben" <Be*@NoSpam.com> a écrit dans le message de
news:uH**************@TK2MSFTNGP10.phx.gbl...
> Hi
>
> I am updating a project from Access to run on our SQL Server DB.
Currently
> I am struggling to connect to the database. I have this code which

is > throwing this error: SQL Server does not exist or access denied.
>
> Dim mydataadapter As New SqlDataAdapter
> mydataadapter.SelectCommand = New SqlCommand(strSQL)
>
> mydataadapter.SelectCommand.Connection = New SqlConnection("Data
> Source=servername\databasename;User ID=domain\username")
>
> mydataadapter.Fill(myDataSet, "tblClient.Client_ID")
>
> myDataGrid.DataSource = myDataSet.Table("tblClient.Client_ID")
>
> myDataGrid.DataBind()
>
> Any ideas
>
> Thanks B
>
>



Nov 18 '05 #6

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

Similar topics

1
by: Marcos | last post by:
Yesterday afternoon I lost access to my local MSDE 2000 sp3(a?) instance. Usinig NT or SQL authentication I get an 'access denied' error when I try to connect. This happened suddenly with no...
3
by: Matthew Louden | last post by:
I attempt to connect ASP.NET application with SQL Server using ADO.NET. I just open a connection, and it had run-time error in line 34: cn.open(): SQL Server does not exist or access denied....
12
by: Simone | last post by:
Hi! I'm an Italian Boy, Excuse Me for my incorrect language. I have a Server with Windows Server 2003 Enterprise Architect and SQL Server 2000 Enterprise. I'm developing an ASP Web...
12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
3
by: Randy | last post by:
Hello All, I'm getting a strange error when trying to perform a file upload. Here's the lines that uploads the file... sSaveLocation = Server.MapPath("PFPDocs") + "\\" + fileName;...
5
by: D Godwin | last post by:
I am running a web service on my local machine (using standard VS.NET test pages) that is attempting to access a SQL database on a network server. C# code looks something like this: public...
0
by: HKSHK | last post by:
This list compares the error codes used in VB.NET 2003 with those used in VB6. Error Codes: ============ 3: This Error number is obsolete and no longer used. (Formerly: Return without GoSub)...
1
by: Atia Amin | last post by:
Hi, I am a new member. Hello to every one. I am new in ASP.NET area. I wrote an ASP.NET web application which was running ok with my old laptop. Currently I have given a new laptop. Now I copied...
1
by: vamshika | last post by:
hi, I got a serious Problem. I get "Server does not exist or access denied" with 80004005 as the error code. the win2003 server uses all the latest components(like iis6,jet..etc) and is upto date....
2
by: Paolo | last post by:
Hi to all, I have an error that drove me crazy. Try the following page that should only allow to upload a file: <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server">...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
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.