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
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多
  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败