Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Error: Microsoft ODBC Driver Manager Data Source name not found

I was just watching the video he
http://www.youtube.com/rstcomputer#p/u/9/T1AyYM6QxnI
Trying to follow the example but some of the text is fuzzy. I typed the
following VBA into Excel:
Sub Rectangle1_Click()

Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset

'Drive code for Access
con.ConnectionString = "CBO=C:\Temp\MyAccess.accdb:" & _
"Driver = (Microsoft Access Dirver (*.accdb));"

'Open DB Connection
con.Open

Set rs.activeconnection = con

rs.Open "Select * from SharePrices"

StartRow = 3

Do Until rf.EOF
'First Field
Cells(StartRow, 4) = rs.Fields(1).Value
'Second Field
Cells(StartRow, 5) = rs.Fields(2).Value
'Third Field
Cells(StartRow, 6) = rs.Fields(3).Value
rs.movenext
StartRow = StartRow + 1
Loop

rs.Close
Set rs = Nothing
con.Close
Set con = Nothing

End Sub

I receive the following error message: 'Run-time error'
Microsoft ODBC Driver Manager Data Source name not found and no default
driver specified.

This line is yellow:
con.Open

I feel the error is he
con.ConnectionString = "DBO=C:\Temp\MyAccess.accdb:" & _
"Driver = (Microsoft Access Dirver (*.accdb));"

I am using Office 2007.

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Microsoft][ODBC SQL Server Driver]String data, right truncation Nuno Gomes Excel Programming 0 February 18th 10 01:41 PM
[Microsoft][ODBC Driver Manager] error LongVacation Excel Programming 3 September 19th 08 06:10 AM
Microsoft][ODBC SQL Server Driver]Syntax error or access violation Jordan Excel Discussion (Misc queries) 0 July 6th 05 06:58 PM
Error processing the dimension '[Microsoft][ODBC dBase Driver] To. Catalin Excel Discussion (Misc queries) 0 April 22nd 05 05:48 PM
Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN rsbitian Excel Programming 0 October 22nd 03 06:11 AM


All times are GMT +1. The time now is 10:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"