duan198123 2015-03-23 14:25
浏览 122
已采纳

在Go Lang中连接到SQL Server 2014

I had a working database connection on a windows 7 machine to SQL Server 2008 R2 using:

     db, err = sqlx.Open("lodbc", connString)

importing the following packages

     "github.com/LukeMauldin/lodbc"
     "github.com/jmoiron/sqlx"

But now using the same driver and changing the connection string to a 2014 SQL Server database located on a remote windows 8 machine, I get a successful connection but a sqlx query breaks saying

datasource 2015/03/23 09:09:37 http: panic serving 127.0.0.1:49346: {IM002} [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Is there another driver I can use? I tried code.google.com/p/odbc and database/mssql packages and those didn't work.

Thanks

  • 写回答

1条回答 默认 最新

  • duanliao6789 2015-03-24 19:30
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型