![]() |
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''. |
All times are GMT +1. The time now is 07:23 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com