I need to connect to the MSSQL server from Arch Linux using ODBC. I use FreeTDS, and with isql, it works:
isql sqlexpress dev dev
But not in PHP. I use PHP interactively:
PHP > $conn = odbc_connect("sqlexpress", 'dev', 'Dev'); PHP > $a=odbc_exec($conn, 'SELECT * FROM measures;'); PHP Warning: odbc_exec(): SQL error: [FreeTDS][SQL Server]The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 1 (""): Data type 0x00 is unknown., SQL state 37000 in SQLExecDirect in php shell code on line 1 Warning: odbc_exec(): SQL error: [FreeTDS][SQL Server]The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 1 (""): Data type 0x00 is unknown., SQL state 37000 in SQLExecDirect in php shell code on line 1
I searched a lot, but I can not find a solution (or even someone with the same problem). My configuration files:
file / etc / odbc.ini:
[sqlexpress] Server = 192.168.10.39 Port = 1433 Driver = FreeTDS Database = capture UserName = dev Password = Dev
/etc/odbcinst.ini:
[FreeTDS] Description = FreeTDS driver Driver = /usr/lib/libtdsodbc.so Setup = /usr/lib/libtdsS.so Trace = Yes TraceFile = /tmp/freetds.log FileUsage = 1 UsageCount = 1
Have a nice day! Mate
source share