nim-lang / db_connector

Unified db connector in Nim
MIT License
20 stars 6 forks source link

db_odbc: Login failed for user ''. #21

Open sdmcallister opened 1 year ago

sdmcallister commented 1 year ago

I have two DSNs for mssql. One uses Integrated authentication and works, while the other uses SQL Server Authentication and gives an error (shown below). I've tested both connections and they work from the odbc data source administrator. I've also tried adding the user name and password and db to the open function.

I'm on Windows 10. Driver is SQL Server Native Client 11.0

import db_connector/db_odbc

var db2 = open("mssql","" ,"", "")
echo "works"
db2.close()

var db = open("mssql_nim","" ,"", "")
db.close()
Warning: 01000 [Microsoft][SQL Server Native Client 11.0][SQL Server]Changed database context to 'Datawarehouse'.
works

Error: 28000 [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user ''.
db_connector-0.1.0-05c335ec678614b973d8a80651971e0719045d14\db_connector\db_odbc.nim(524) open
db_connector-0.1.0-05c335ec678614b973d8a80651971e0719045d14\db_connector\db_odbc.nim(176) dbError
Error: unhandled exception: ODBC Error [DbError]

Also, is it possible to silence the Warning msg?