Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8941465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:18:30+00:00 2026-06-15T11:18:30+00:00

I have to connect to a MSSQL server from Arch Linux with ODBC. I

  • 0

I have to connect to a MSSQL server from Arch Linux with ODBC.
I use FreeTDS, and with isql, it’s working:

isql sqlexpress dev Dev

But not in PHP.
I use PHP in interactive mode:


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’ve searched a lot, but I can’t find any solution (or even somebody with the same problem).
My config files:

/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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:18:31+00:00Added an answer on June 15, 2026 at 11:18 am

    Here’s my working configuration files for connecting to a MSSQL database from Ubuntu:

    /etc/odbc.ini

    # Define a connection to the MSSQL server.
    # The Description can be whatever we want it to be.
    # The Driver value must match what we have defined in /etc/odbcinst.ini
    # The Database name must be the name of the database this connection will connect to.
    # The ServerName is the name we defined in /etc/freetds/freetds.conf
    # The TDS_Version should match what we defined in /etc/freetds/freetds.conf
    [ebe]
    Description             = MSSQL Server
    Driver                  = freetds
    Database                = my_database
    ServerName              = my_server_name
    TDS_Version             = 8.0
    

    /etc/odbcinst.ini

    # Define where to find the driver for the Free TDS connections.
    [freetds]
    Description     = MS SQL database access with Free TDS
    Driver          = /usr/lib/i386-linux-gnu/odbc/libtdsodbc.so
    Setup           = /usr/lib/i386-linux-gnu/odbc/libtdsS.so
    UsageCount      = 1
    
    # Change the "no" to "yes" to enable ODBC logging.
    [ODBC]
    Trace           = no
    TraceFile       = /tmp/odbc.log
    

    /etc/freetds/freetds.conf

    [global]
            # If you get out-of-memory errors, it may mean that your client
            # is trying to allocate a huge buffer for a TEXT field.  
            # Try setting 'text size' to a more reasonable limit 
            text size = 64512
    
    # Define a connection to the MSSQL server.
    [my_server_name]
        host = my_server_domain_or_ip
        port = 1433
        tds version = 8.0
    

    And finally, here’s my PHP connection string:

    $this->db_connection = new PDO("dblib:dbname=my_database;host=my_server_domain_or_ip", 'username', 'password');
    

    I believe setting the tds version to 8.0 could be a big help to you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have mysql DB on cloud linux server. I am able to connect db
So I need to connect to a mssql server via Windows Authentication from a
I'm trying to connect to an MSSQL database from python on Linux (SLES). I
Unable to connect to our company MSSQL server from one of our FreeBSD servers.
I use the ruby-gem sequel to read utf-8-encoded data from a MSSQL-Server table. The
i have a database in MsSQL, with which i connect from my PHP code
I have the following error message: SQLSTATE[HY000] [2003] Can't connect to MySQL server on
I have XAMPP running on my desktop and can connect to the MySQL server
I have a ton of experience connecting to MySQL, but I'm attempting to connect
I have made the remote database backup (MSSQL Server 2005 Express) to the localhost,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.