mattn / go-adodb

Microsoft ActiveX Object DataBase driver for go that using exp/sql
http://mattn.kaoriya.net/
MIT License
142 stars 36 forks source link

(Class not register) Provider cannot be found. It may not be properly installed. "發生例外狀況。 (找不到提供者。它可能未被正確安裝。)" #47

Closed YamiOdymel closed 4 years ago

YamiOdymel commented 4 years ago

with the mdb.go example it shows the following error message

create mdb 發生例外狀況。 (類別未登錄)
> Class not registered

this playground shows another message but it has the same meaning.

"發生例外狀況。 (找不到提供者。它可能未被正確安裝。)"
>  Provider cannot be found. It may not be properly installed.

image

YamiOdymel commented 4 years ago

Okay, so basically this library calls a 32-bit component that cannot be run on a x64 computer. This issue says all. Run the program under x86 and you'll be fine.

set GOARCH=386

Detail: https://stackoverflow.com/questions/15478117/class-not-registered-exception

The error itself is clear - one of the classes you are using is not registered on the Win7 system (ie : missing DLL, etc). This could be because the component/library was never installed on the Win7 system or the installation is corrupt. It could also be because it is a 32-bit component and you are targeting AnyCPU or x64 in your compilation options.