minus5/gofreetds

Support for sql server 2000?

Closed this issue ยท 3 comments

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? :(

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.

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);
}

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)