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

go run csv.go have an error, err is empty but is not nil #33

Closed hzxgo closed 6 years ago

hzxgo commented 6 years ago

@mattn I am go run csv.go have an error. development environment:macOS10.12.6 + go1.9.2

package main

import (
    "fmt"
    "database/sql"
    _ "github.com/mattn/go-adodb"
    "os"
)

func main() {
    os.Remove("example.csv")

    db, err := sql.Open("adodb", `Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.;Extended Properties="Text;HDR=NO;FMT=Delimited"`)
    if err != nil {
        fmt.Println(err)
        return
    }

    _, err = db.Exec("create table example.csv(f1 text, f2 text, f3 text)")
    if err != nil {   **_// The err is empty but is not nil_** 
        fmt.Println(err)  
        return
    }
    ......
}
mattn commented 6 years ago

AFAIK, macOS doesn't work Windows ADODB.