Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
[Microsoft][ODBC SQL Server Driver]String data, right truncation | Excel Programming | |||
[Microsoft][ODBC Driver Manager] error | Excel Programming | |||
Microsoft][ODBC SQL Server Driver]Syntax error or access violation | Excel Discussion (Misc queries) | |||
Error processing the dimension '[Microsoft][ODBC dBase Driver] To. | Excel Discussion (Misc queries) | |||
Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN | Excel Programming |