minus5 / gofreetds

Go Sql Server database driver.
MIT License
113 stars 48 forks source link

Support for sql server 2000? #46

Closed huaguoping closed 7 years ago

huaguoping commented 7 years ago

Could I use this driver to connect sql server 2000?When I did this, I got an error:

Cannot connect: dbopen error Msg 20002, Level 9 Adaptive Server connection failed (my sql server host)

I used the correct connect information, host, user name, password, database name... but it dose not work, could anyone help me? :(

MarkSonghurst commented 7 years ago

I have not tried SQL Server 2000, but you might need to modify your /etc/freetds.conf file to set the TDS Version. But first, have you tried connecting using the FreeTDS tsql connection testing program? man tsql

That should help you figure out any connection issues without needing to write code.

hongjinlin commented 5 years ago

In my case,change the tds verson to DBVERSION_70 and it works! conn.go static void my_setlversion(LOGINREC* login) { //dbsetlversion(login, DBVERSION_72); dbsetlversion(login, DBVERSION_70); }

aleskandro commented 3 years ago

Compatibility Mode set to Sybase did the trick!

fmt.Sprintf("user=%s;pwd=;database=%s;host=%s;port=%d; Compatibility Mode=Sybase",
        conf.DBMSUser, conf.DBMSDBName, conf.DBMSHost, conf.DBMSPort)