Runtime Error 2147467259...80004005. Please help

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875

I got this code from web...does not work with me...

Error "runtime error 2147467259...80004005.
[MS ODBC driver manager] Data source bame not found and no default driver specified..."


Is there any settings i need to take care of before running this code. besides the reference that i did for MS ADO ...?

Thanks for taking care of this. :)


Pedie
Code:
[/FONT]
[FONT=Courier New][/FONT] 
[FONT=Courier New]Option Explicit
Sub exceltoAcc()[/FONT]
[FONT=Courier New]Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim startrow As Long[/FONT]
[FONT=Courier New]con.ConnectionString = "DBQ=E:\Personal_Files\ADO_Excel_Acess\MyDB.mdb;" & "Driver=(Microsoft Access Driver (*.mdb));"[/FONT]

[FONT=Courier New]con.Open[/FONT]
[FONT=Courier New]Set rs.ActiveConnection = con
rs.Open "Select ' from MyTB"[/FONT]
[FONT=Courier New]startrow = 3[/FONT]
[FONT=Courier New]Do Until rs.EOF[/FONT]
[FONT=Courier New]Cells(startrow, 4) = rs.Fields(0).Value
Cells(startrow, 5) = rs.Fields(1).Value
rs.MoveNext
startrow = startrow + 1
Loop
rs.Close
Set rs = Nothing
con.Close
Set con = Nothing[/FONT]
[FONT=Courier New]End Sub
[/FONT]
[FONT=Courier New][/FONT] 
[FONT=Courier New]
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,224,592
Messages
6,179,786
Members
452,942
Latest member
VijayNewtoExcel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top