473,654 Members | 3,104 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.S electCommand = New SqlCommand(strS QL)

mydataadapter.S electCommand.Co nnection = New SqlConnection(" Data
Source=serverna me\databasename ;User ID=domain\usern ame")

mydataadapter.F ill(myDataSet, "tblClient.Clie nt_ID")

myDataGrid.Data Source = myDataSet.Table ("tblClient.Cli ent_ID")

myDataGrid.Data Bind()

Any ideas

Thanks B
Nov 18 '05 #1
5 2786
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 "intergrate d 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******** ******@TK2MSFTN GP10.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.S electCommand = New SqlCommand(strS QL)

mydataadapter.S electCommand.Co nnection = New SqlConnection(" Data
Source=serverna me\databasename ;User ID=domain\usern ame")

mydataadapter.F ill(myDataSet, "tblClient.Clie nt_ID")

myDataGrid.Data Source = myDataSet.Table ("tblClient.Cli ent_ID")

myDataGrid.Data Bind()

Any ideas

Thanks B

Nov 18 '05 #2
Ben
Hi

I was origionally using this connection string:

mydataadapter.S electCommand.Co nnection = New SqlConnection(" Data
Source=server;I nitial Catalog=databas e;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******** ********@TK2MSF TNGP12.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 "intergrate d 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******** ******@TK2MSFTN GP10.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.S electCommand = New SqlCommand(strS QL)

mydataadapter.S electCommand.Co nnection = New SqlConnection(" Data
Source=serverna me\databasename ;User ID=domain\usern ame")

mydataadapter.F ill(myDataSet, "tblClient.Clie nt_ID")

myDataGrid.Data Source = myDataSet.Table ("tblClient.Cli ent_ID")

myDataGrid.Data Bind()

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******** ******@TK2MSFTN GP11.phx.gbl...
Hi

I was origionally using this connection string:

mydataadapter.S electCommand.Co nnection = New SqlConnection(" Data
Source=server;I nitial Catalog=databas e;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******** ********@TK2MSF TNGP12.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 "intergrate d 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******** ******@TK2MSFTN GP10.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.S electCommand = New SqlCommand(strS QL)

mydataadapter.S electCommand.Co nnection = New SqlConnection(" Data
Source=serverna me\databasename ;User ID=domain\usern ame")

mydataadapter.F ill(myDataSet, "tblClient.Clie nt_ID")

myDataGrid.Data Source = myDataSet.Table ("tblClient.Cli ent_ID")

myDataGrid.Data Bind()

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******** ******@TK2MSFTN GP11.phx.gbl...
Hi

I was origionally using this connection string:

mydataadapter.S electCommand.Co nnection = New SqlConnection(" Data
Source=server;I nitial Catalog=databas e;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******** ********@TK2MSF TNGP12.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 "intergrate d 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******** ******@TK2MSFTN GP10.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.S electCommand = New SqlCommand(strS QL)

mydataadapter.S electCommand.Co nnection = New SqlConnection(" Data
Source=serverna me\databasename ;User ID=domain\usern ame")

mydataadapter.F ill(myDataSet, "tblClient.Clie nt_ID")

myDataGrid.Data Source = myDataSet.Table ("tblClient.Cli ent_ID")

myDataGrid.Data Bind()

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******@takem pis.com> wrote in message
news:ez******** ******@TK2MSFTN GP10.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******** ******@TK2MSFTN GP11.phx.gbl...
Hi

I was origionally using this connection string:

mydataadapter.S electCommand.Co nnection = New SqlConnection(" Data
Source=server;I nitial Catalog=databas e;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******** ********@TK2MSF TNGP12.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 "intergrate d 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******** ******@TK2MSFTN GP10.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.S electCommand = New SqlCommand(strS QL)
>
> mydataadapter.S electCommand.Co nnection = New SqlConnection(" Data
> Source=serverna me\databasename ;User ID=domain\usern ame")
>
> mydataadapter.F ill(myDataSet, "tblClient.Clie nt_ID")
>
> myDataGrid.Data Source = myDataSet.Table ("tblClient.Cli ent_ID")
>
> myDataGrid.Data Bind()
>
> 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
2028
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 changes to the server on my part. I've tinkered with the Client Network Utility settings, from Multiprotocol only, every combination of Multi protocol, TCP/IP, and named pipes. I've tried connecting with my network machine name, using (local), and...
3
2520
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. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details:...
12
2141
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 Application, but when i try to connect to my SQL Server Database by this connectionstring "data source=MYSERVER;initial catalog=MYDATABASE;password=MYPWD;user id=Sa"
12
2774
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 both the iis and sql server in a single machine. Not too long ago, the machine had some hardware problems, and management has decided to purchase new servers, for both asp.net and sql server.
3
4213
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; fileInput.PostedFile.SaveAs(sSaveLocation); When it runs, I'm getting a "Access to the path xxx is denied" error. On the server (Server 2003) I've given the ASP.NET and Everyone Full Control but still I get the error. I've also given IUSR_machinename Full...
5
2401
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 string GetSomething() { SqlConnection con = new SqlConnection(); con.ConnectionString = ConfigurationSettings.AppSettings.ToString();
0
23477
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) 5: Procedure call or argument is not valid. 6: Overflow. 7: Out of memory.
1
4185
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 my application to the new laptop and I am experiencing as SQL Server connection error: "SQL Server does not exist or access denied". Following is a simply ASP.NET application to test the connection and I am getting following error: For your...
1
4629
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. The Asp website and its database(sql server) are in two different servers. Can any one help me out. Did enybodyelse come accross such issue?????? I referred the msdn and tried the solutions(like setting permissions..etc) already but none of them...
2
8024
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"> <title>Untitled Page</title> </head> <body>
0
8709
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8494
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7309
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2719
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1924
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1597
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.