Ok in WinXP, but error in Win10 - Microsoft ODBC dBase Driver (*.DBF) Datasource name not found and no default driver specified

SevenDP

New Member
Joined
Mar 10, 2016
Messages
21
Hi Guys

I have maintenance old macro, this macro work in WinXP 32bit & Office 2010
but now user need to upgrade computer into Win10 x64 & Office 365

there are a problem when accessing this code
Code:
data_path = Left(ThisWorkbook.Path, 31)

cn_bank.Open "driver={Microsoft dBase Driver (*.dbf)};" & _
    "driverid=277;dbq=" & data_path
   
   rs_bank.Open "select * from GBANKTRN.DBF", cn_bank, , , adCmdText

the error was:

Run-time error -2147467259 (80004005): [Microsoft] [ODBC Driver Manager] Datasource name not found and no default driver specified

debugger got yellow line in this line:

Code:
cn_bank.Open "driver={Microsoft dBase Driver (*.dbf)};" & _
    "driverid=277;dbq=" & data_path

this dbf file is compatible with Clipper/Foxplus/Foxbase
the macro code needs to read & modify this dbf file

should i need to install some driver or should I change the code ?
any advice ?

i already checked the reference all references is checked in both windows, but the office 365 got newer version

please help & thanks before
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
solved,
change the connection string from
Code:
cn_bank.Open "driver={Microsoft dBase Driver (*.dbf)};" & _
    "driverid=277;dbq=" & data_path


to


Code:
cn_bank.Open "driver={Microsoft Access dBase Driver (*.dbf, *.ndx, *.mdx)};" & _
    "driverid=277;dbq=" & data_path



thanks guys
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,383
Members
448,955
Latest member
BatCoder

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