freetds

Django: Unable to connect to Microsoft SQL Server

耗尽温柔 提交于 2019-12-06 15:54:17
I am unable to connect to the MS SQL server using Django (Version- 1.11.3) Here is the error, I seem to be getting: django.db.utils.OperationalError: ('08001', u'[08001] [unixODBC][FreeTDS][SQL Server]Unable to connect to data source (0) (SQLDriverConnect)') This is the odbcinst.ini file: [FreeTDS] Description=TDS driver (Sybase/MS SQL) Driver=/usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so Setup=/usr/lib/x86_64-linux-gnu/odbc/libtdsS.so CPTimeout= CPReuse= UsageCount=2 This is the django settings.py snippet: DATABASES = { 'mssql': { 'ENGINE':'sql_server.pyodbc', 'NAME': '<NAME>', 'USER': '<USER>

How can I use SQL Server Table Views as Rails Models (Read Only)?

南笙酒味 提交于 2019-12-06 14:22:22
I'm using SQL Server as my database for my Rails project. I'm trying to create some models to use for a 3rd party database and only want to read from this database. So I made a view of the table I wanted to create an object for and then I wanted to point my active record model to it. However, in rails console I don't get back expected results. The only example that gives back some correct information is when I do a count on the object as shown in Example 3 below. I'm using the following gems to connect to my SQL Server: gem 'tiny_tds' gem 'activerecord-sqlserver-adapter' Also I have installed

mssql_connect(): Unable to connect to server (without freetds.conf)

狂风中的少年 提交于 2019-12-06 13:16:17
I have 2 servers: one is OpenSUSE, another one is SLES 11 sp2 Suse Linux Enterprise Server. In order to have connection to MSSQL I have to install mssql.so for php. OpenSUSE permits to install mssql from rpm. SLES - does not have mssql rpm, and this is why need to compile it. OpenSUSE: mssql rpm installed => $server="172.x.x.x:49888"; $username="username"; $password="password"; $link = mssql_connect($server, $username, $password); here successfully connected to MSSQL! SLES: with mssql.so compiled => $server="172.x.x.x:49888"; $username="username"; $password="password"; $link = mssql_connect(

Error connecting to MS SQL Server using pyODBC, unixODBC and FreeTDS (on a Mac)

懵懂的女人 提交于 2019-12-06 06:03:01
I am getting an error when trying to connect to a MS SQL server in python, using the pyODBC --> unixODBC --> FreeTDS --> MS SQL stack. I’ve spent a lot of time on this, and there are some great resources if you’ve reached this question with more fundamental problems getting a connection to work here and here . However, my question is regarding an error that (I think) is very close to the finish line of this very frustrating experience. Specifically, this code in jupyter notebook: pyodbc.connect( 'DRIVER=/usr/local/lib/libtdsodbc.so;' 'SERVER=MyServerIP;' 'PORT=1433;' 'DATABASE= DatabaseName;'

Why won't my server connect to a remote MSSQL server using PHP mssql_connect?

一个人想着一个人 提交于 2019-12-06 05:58:44
I've had to move an app we wrote for a client to a new server and a remote connection I was initiating with PHP mssql_connect has ceased to work. I noticed that PHP wasn't compiled with mssql so I asked the server admin to install it. I can verify that it's now installed via PHP info but I now get a consistent "Unable to connect to server" error from mssql_connect. Here's the very simple PHP script I'm running: $myServer = "myserver.com:5000"; $myUser = "myusername"; $myPass = "mypassword"; $dbhandle = mssql_connect($myServer, $myUser, $myPass) or die("Couldn't connect to SQL Server on

FreeTDS hangs indefinitely after Microsoft SQL Express 2012 Install

对着背影说爱祢 提交于 2019-12-06 05:20:58
FreeTDS hangs indefinitely when I try to connect to a server: C:\FreeTDS\bin>tsql -H localhost -p 1433 locale is "English_United States.1252" locale charset is "CP1252" using default charset "CP1252" (nothing else is displayed, can only exit with ^C) Identical behaviour occurs when I run tsql -S <servername> . I recently uninstalled Microsoft SQL Server Management Studio, and then installed the Express edition. Connection with tsql -H localhost -p 1433 worked before the uninstall/install. Running tsql -C yields: Compile-time settings (established with the "configure" script) Version: freetds

“USE statement is not supported to switch between databases” when running query

家住魔仙堡 提交于 2019-12-06 04:14:22
I get the following error when trying to select a database with php's standard mssql_select_db function: USE statement is not supported to switch between databases. Use a new connection to connect to a different Database. (severity 16) . So i'm stumped as in where to go from here. Connection Code: $link = mssql_connect('dsn', 'user@server', 'password'); if (!$link) { die('Unable to connect!'); } if (!mssql_select_db('db', $link)) { die('Unable to select database!'); } $result = mssql_query('SELECT * FROM yourtable'); while ($row = mssql_fetch_array($result)) { var_dump($row); } My system setup

Using UnixODBC and FreeTDS to connect to Pervasive SQL server in ubuntu?

空扰寡人 提交于 2019-12-06 04:14:21
I am trying to connect to a Pervasive Sql Server which is running on Windows 10 from an Ubuntu 14.04.4 server. I am using the following services to try connect to the server: FreeTDS unixODBC Before starting I tried to ping the host machine from the vm console with success. I then run the following command to check FreeTDS has installed correctly; tsql -C Which returned: Compile-time settings (established with the "configure" script) Version: freetds v0.95.95 freetds.conf directory: /usr/local/etc MS db-lib source compatibility: no Sybase binary compatibility: no Thread safety: yes iconv

FreeTDS - tsql connects, isql fails

余生颓废 提交于 2019-12-06 00:48:51
问题 I'm trying to connect to a database on my host machine (windows xp, sql server 05). My guest machine is Ubuntu 10.04. I can connect and execute commands with tsql, but isql fails. Below are my config files and error messages. freetds.conf text size = 64512 [SQLEXPRESS] host = 192.168.163.1 port = 1433 tds version = 7.0 odbcinst.ini [FreeTDS] Description = TDS driver (Sybase/MS SQL) Driver = /usr/lib/odbc/libtdsodbc.so Setup = /usr/lib/odbc/libtdsS.so CPTimeout = CPReuse = FileUsage = 1 odbc

Trouble installing pymssql on Windows

 ̄綄美尐妖づ 提交于 2019-12-05 16:34:24
I can't find great support for pymssql installation support on Windows. I'm trying to connect to an enterprise database through another employee's python wrapper. This wrapper requires my installing of pymssql. The RTFM on this doesn't have very explicit instructions on the installation process of FreeTDS and OpenSSL. Steps to Install All downloaded files (FreeTDS and OpenSSL) are from the RTFM link mentioned above. There is mention of adding both downloads to a C:\Program Files folder and adding the binaries into the system PATH , so I did this: FreeTDS Downloaded FreeTDS >> created the