PC Review


Reply
Thread Tools Rate Thread

Code that Worked with SQL 2000 Does Not with SQL 2005

 
 
=?Utf-8?B?Q2hhcGxhaW4gRG91Zw==?=
Guest
Posts: n/a
 
      11th Apr 2007
Excel 2003. SQl Server 2005. I have the following code that worked fine
with SQL Server 2000. Now that I have installed SQL 2005, it no longer
works. What do I need to change?

Dim cn As ADODB.Connection
Dim sql As String
On Error GoTo Err_PT
Set cn = New ADODB.Connection
cn.Open "Provider=sqloledb;" & _
"Data Source=HQServer;" & _
"Initial Catalog=Good_News_FE;" & _
"User ID=FEOpen7;" & _
"Password=fe"

Incidentally, The SQL 2005 Server is names HQSERVER, the database is named
Good_News_FE. The user name FEOpen 7 exists and it has a password of fe.
Moreover, user FEOpen7 has been defined to have access to the database.

When the above code executes, it returns the follwing error:

Error Number: -2147467259
Error Text: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist
or access denied.


THANKS for any help that could be provided. God bless.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q2hhcGxhaW4gRG91Zw==?=
Guest
Posts: n/a
 
      11th Apr 2007
My own error. The new SQL instance is called HQServer\HQServer. When I
changed that, the code worked. Thanks.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org


"Chaplain Doug" wrote:

> Excel 2003. SQl Server 2005. I have the following code that worked fine
> with SQL Server 2000. Now that I have installed SQL 2005, it no longer
> works. What do I need to change?
>
> Dim cn As ADODB.Connection
> Dim sql As String
> On Error GoTo Err_PT
> Set cn = New ADODB.Connection
> cn.Open "Provider=sqloledb;" & _
> "Data Source=HQServer;" & _
> "Initial Catalog=Good_News_FE;" & _
> "User ID=FEOpen7;" & _
> "Password=fe"
>
> Incidentally, The SQL 2005 Server is names HQSERVER, the database is named
> Good_News_FE. The user name FEOpen 7 exists and it has a password of fe.
> Moreover, user FEOpen7 has been defined to have access to the database.
>
> When the above code executes, it returns the follwing error:
>
> Error Number: -2147467259
> Error Text: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist
> or access denied.
>
>
> THANKS for any help that could be provided. God bless.
> --
> Dr. Doug Pruiett
> Good News Jail & Prison Ministry
> www.goodnewsjail.org

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code ? Worked in IE6 but not IE7 Vince Microsoft Frontpage 2 1st Apr 2006 09:43 PM
Problem getting cookie from code-behind (worked in code-beside) Alan Silver Microsoft ASP .NET 1 15th Sep 2005 06:23 PM
My code has worked before ... why not now? =?Utf-8?B?TWVnYW4=?= Microsoft Access 4 13th Sep 2005 03:35 PM
can VS.net 2005 with vs.net 2003 worked together in one tony Microsoft Dot NET 7 20th Nov 2004 03:20 AM
Code that worked ?! =?Utf-8?B?RA==?= Microsoft Access Reports 1 26th Oct 2004 09:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:29 AM.