Solved

oledb connection to SQL Server not working

Posted on 2010-08-13
3
429 Views
Last Modified: 2013-11-27
In Access 2007, (trying to access SQL Server) I have the following code:
    Dim cn As New ADODB.Connection
    Dim strCN As String
    strCN = "Provider=SQLOLEDB;Server=10.10.10.1;" & _
             "Initial Catalog='Websites';User ID=sa;PWD=xxxxxxxx"

    cn.CommandTimeout = 3000000
    cn.Open

This gives the following error:
[Microsoft][ODBSC Driver Manager] Data Source Name not found and no default driver specified
0
Comment
Question by:jking1234
  • 2
3 Comments
 
LVL 24

Expert Comment

by:Bitsqueezer
ID: 33430247
Hi,

I would recommend to use the SQLNCLI driver instead (must be installed on Windows XP machines, not available by default).

Moreover you should make sure that TCP/IP is enabled on the SQL Server if you access the server by IP address.
You can find examples of connection strings here:
http://www.connectionstrings.com/sql-server-2005#p2

There is also an example of how to use the IP address.

And I hope that this string was only an example and you don't really try to connect to the SQL Server using the "sa" account...:-)

Cheers,

Christian
0
 

Accepted Solution

by:
jking1234 earned 0 total points
ID: 33544602
fixed it myself
0
 

Author Comment

by:jking1234
ID: 33544625
zzz
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now