clisp、plain-odbc 以及连接到 sql server 数据库
我在使用 unixODBC 从 openbsd 盒子连接到 sql server 数据库时遇到问题。当我使用 isql 时,我的表现很好:
$ isql localProdSqlServer jegdemir GBE#oct
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>
所以我知道 DSN 已设置并且 unixODBC 工作正常。然而,当我打开 clisp 并尝试使用 plain-odbc 连接时,我无法到达那里:
$ clisp
<..snip..>>
[1]> (asdf:oos 'asdf:load-op :plain-odbc)
<..snip..>
[2]> (setf *con* (plain-odbc:connect "localProdSqlServer" "jegdemir" "GBE#oct"))
*** - [unixODBC][FreeTDS][SQL Server]Unable to connect to data source, error
code 0, State: S1000.
The following restarts are available:
ABORT :R1 Abort main loop
Break 1 [3]>
我对 lisp 相当陌生,所以我在诊断问题时遇到了一些麻烦。任何帮助将不胜感激。
I'm having issues connecting to a sql server database from an openbsd box using unixODBC. When I use isql I get through just fine:
$ isql localProdSqlServer jegdemir GBE#oct
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>
so I know the DSN is setup and unixODBC is working properly. However when I crack open clisp and try to connect using plain-odbc I can't get there:
$ clisp
<..snip..>>
[1]> (asdf:oos 'asdf:load-op :plain-odbc)
<..snip..>
[2]> (setf *con* (plain-odbc:connect "localProdSqlServer" "jegdemir" "GBE#oct"))
*** - [unixODBC][FreeTDS][SQL Server]Unable to connect to data source, error
code 0, State: S1000.
The following restarts are available:
ABORT :R1 Abort main loop
Break 1 [3]>
I'm fairly new to lisp so I'm having a bit of trouble diagnosing the issue. Any help would be most appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 plain-odbc 的工作方式,您可能需要在 /etc/odbc.ini 中指定 DSN,例如:
作为替代方案,CLSQL 库有一个支持连接字符串的 ODBC 后端
:工作我使用 CLSQL 连接到 SQL一直都是服务器。
Depending on how plain-odbc works, you may need to specify a DSN in /etc/odbc.ini, something like:
As an alternative, the CLSQL library has an ODBC backend that supports connection strings:
At work I use CLSQL to connect to SQL Server all the time.