PC Review


Reply
Thread Tools Rate Thread

Connecting to SQL Server via VBA and ADO

 
 
leonard webel
Guest
Posts: n/a
 
      31st May 2007
Hi,

Im trying to connect to a sqlserver using this:

MyConnObj.Open _
"Provider = sqloledb;" & _
"Data Source={ServerName};" & _
"Initial Catalog={DatabaseName};" & _
"User ID={UserName};" & _
"Password={Password};"

But I am getting an error message:

Run-time error '-2147467259 (80004005)':

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access
denied

I have got a System DSN which does connect to the database successfully. It
is using standard SQL server connection. If i could supply the system DSN Im
sure it would work?

Please help
Thanks


 
Reply With Quote
 
 
 
 
MH
Guest
Posts: n/a
 
      31st May 2007
http://support.microsoft.com/kb/328306

MH

"leonard webel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> Im trying to connect to a sqlserver using this:
>
> MyConnObj.Open _
> "Provider = sqloledb;" & _
> "Data Source={ServerName};" & _
> "Initial Catalog={DatabaseName};" & _
> "User ID={UserName};" & _
> "Password={Password};"
>
> But I am getting an error message:
>
> Run-time error '-2147467259 (80004005)':
>
> [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access
> denied
>
> I have got a System DSN which does connect to the database successfully.
> It
> is using standard SQL server connection. If i could supply the system DSN
> Im
> sure it would work?
>
> Please help
> Thanks
>
>



 
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
An error has occurred while establishing a connection to the server.When connecting to SQL Server 2005, this failure may be caused by the factthat under the default settings SQL Server does not allow remote connections. mina Microsoft VB .NET 0 8th Oct 2008 07:12 AM
An error has occurred while establishing a connection to the server.When connecting to SQL Server 2005, this failure may be caused by the factthat under the default settings SQL Server does not allow remote connections. mina Microsoft Dot NET 0 8th Oct 2008 07:11 AM
Help. Getting a An error has occurred while establishing a connectionto the server. When connecting to SQL Server 2005, this failure may be causedby the fact that under the default settings SQL Server does not allow remote aboutjav.com@gmail.com Microsoft ASP .NET 0 3rd May 2008 01:43 PM
when i am connecting vpn to client my system will not connecting server koteshsvv@gmail.com Microsoft Windows 2000 RAS Routing 1 24th Mar 2007 02:11 PM
Troubleshoot connecting client to SQL Server instance on a server John Hackert Microsoft Access ADP SQL Server 6 31st Jan 2007 10:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:55 PM.