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

报告相同问题?

悬赏问题

  • ¥20 如何通过代码传输视频到亚马逊平台
  • ¥15 php查询mysql数据库并显示至下拉列表中
  • ¥15 freertos下使用外部中断失效
  • ¥15 输入的char字符转为int类型,不是对应的ascall码,如何才能使之转换为对应ascall码?或者使输入的char字符可以正常与其他字符比较?
  • ¥15 devserver配置完 启动服务 无法访问static上的资源
  • ¥15 解决websocket跟c#客户端通信
  • ¥30 Python调用dll文件输出Nan重置dll状态
  • ¥15 浮动div的高度控制问题。
  • ¥66 换电脑后应用程序报错
  • ¥50 array数据同步问题