Solved

oledb connection to SQL Server not working

Posted on 2010-08-13
3
437 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

707 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