Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
clisp、普通odbc和连接到sql server数据库_Lisp_Odbc_Common Lisp_Dsn_Openbsd - Fatal编程技术网

clisp、普通odbc和连接到sql server数据库

clisp、普通odbc和连接到sql server数据库,lisp,odbc,common-lisp,dsn,openbsd,Lisp,Odbc,Common Lisp,Dsn,Openbsd,我在使用unixODBC从openbsd盒连接到sql server数据库时遇到问题。当我使用isql时,我很好地通过了: $ isql localProdSqlServer jegdemir GBE#oct +---------------------------------------+ | Connected! | | | | sql-statement

我在使用unixODBC从openbsd盒连接到sql server数据库时遇到问题。当我使用isql时,我很好地通过了:

$ isql localProdSqlServer jegdemir GBE#oct 
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> 
所以我知道DSN已经设置好,unixODBC工作正常。但是,当我打开clisp并尝试使用普通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]> 
$clisp
>
[1] >(asdf:oos'asdf:load op:plain odbc)
[2] >(setf*con*(普通odbc:connect“localProdSqlServer”“jegdemir”“GBE#oct”))
***-[unixODBC][FreeTDS][SQL Server]无法连接到数据源,错误
代码0,状态:S1000。
以下重新启动可用:
中止:R1中止主循环
中断1[3]>

我是lisp的新手,所以在诊断问题时遇到了一些麻烦。非常感谢您的帮助。

根据普通odbc的工作方式,您可能需要在/etc/odbc.ini中指定DSN,例如:

[localProdSqlServer]
Driver          = FreeTDS
Description     = localProdSqlServer TDS driver (Sybase/MS SQL)
Trace           = No
Servername      = localProdSqlServer
Database        = DATABASE_NAME
作为替代方案,库具有支持连接字符串的后端:

(clsql:connect '("friendly-server-name" "friendly-username" "" 
     :connection-string "DRIVER={FreeTDS};SERVER=localProdSqlServer;DATABASE=DATABASE_NAME;UID=jegdemir;PWD=GBE#oct;PORT=1433;TDS_Version=8.0;APP=clsql") 
           :database-type :odbc)
在工作中,我一直使用CLSQL连接到SQL Server