unixodbc

How do I configure pyodbc to correctly accept strings from SQL Server using freeTDS and unixODBC?

我与影子孤独终老i 提交于 2019-12-12 08:10:13
问题 I can not get a valid string from an MSSQL server into python. I believe there is an encoding mismatch somewhere. I believe it is between the ODBC layer and python because I am able to get readable results in tsql and isql. What character encoding does pyodbc expect? What do I need to change in the chain to get this to work? Specific Example Here is a simplified python script as an example: #!/usr/bin/env python import pyodbc dsn = 'yourdb' user = 'import' password = 'get0lddata' database =

Connect to MS Access remote .mdb file from php on linux

末鹿安然 提交于 2019-12-12 08:08:32
问题 I have been digging internet for couple days, reading very old information, that leads to very old and nonexisting sites, still, I understood, what is needed to achieve my goal. We have a file.mdb on server running WindowsXP, so I need to add it to ODBC data sources. I do that with simple steps, ending up with "System DSN", that allows access to that .mdb file I need to install on this same server some sort of ODBC bridge, that would allow me to create remote connection to this server, making

Go/Golang sql.DB reuse in functions

霸气de小男生 提交于 2019-12-12 07:50:22
问题 sql.Open() returns a variable of type *sql.DB I have a function that calls 10 other functions that all need to make database calls Is it more correct/efficient to: Send the *sql.DB pointer to every function, or Create a new *sql.DB object in each function Meaning func DoLotsOfThings() { db, _ := sql.Open() defer db.Close() DoTask1(db) DoTask2(db) } or func DoLotsOfThings() { DoTask1() DoTask2() } func DoTask1() { db, _ := sql.Open() defer db.Close() } func DoTask1() { db, _ := sql.Open()

FreeBSD equivalent to unixodbc-dev

丶灬走出姿态 提交于 2019-12-12 05:48:45
问题 I'm trying to compile Erlang on FreeBSD, and I want to include the odbc licenses. On Ubuntu, if you add the unixodbc-dev package, that ensures that odbc gets compiled with Erlang, however, I can't find a package that works equivalently with FreeBSD. I've tried installing the unixODBC package, and the libodbc++ with libiodbc packages. Neither of these work. I've also tried download unixodbc from unixodbc.org and installing that, to no avail. So if there's a package I can use, or if there's

pyODBC refuses to look for unixODBC, instead looks for iODBC

半世苍凉 提交于 2019-12-12 02:33:47
问题 Is there a way to get pyODBC v3.0.10 to look for the unixODBC driver, instead of the iODBC driver it seems to want to look for? My understanding is that pyODBC v3.0.10 is supposed to do this by default, while versions prior to v3.0.7 required a manual edit to the setup.py file (see reference here). One more clue, I ran this code to list my ODBC sources, and it returned nothing: sources = pyodbc.dataSources() dsns = list(sources.keys()) dsns.sort() sl = [] for dsn in dsns: sl.append('%s [%s]'

Encoding is not proper when query from Apache/PHP

走远了吗. 提交于 2019-12-11 23:02:50
问题 I have some problem with connection to my Vertica. I use PHP and PDO ODBC driver (thrue unixODBC). When I connect to Vertica via isql and select records from table all data are fine encoded - fields with UTF-8 (non ASCII symbols, for example cyrillic) correctly prints. If connect from web with PHP script and execute same query that fields has some unicode characters like this \u001A\u001A\u001A\u001A Each \u001A represent a one non ASCII symbol and can't be printed. I found that this problem

unixODBC/FreeTDS results truncated to 255 character

别来无恙 提交于 2019-12-11 22:30:09
问题 UPDATE 2 I turned on tracing and ran my sample query. Here is the trace. I do see the statement Strlen Or Ind = 0x7fff9c84ee88 -> 255 . The indicator variable is defined as SQLLEN indicator; Is this not initialized properly? [ODBC][22407][1379343424.503572][__handles.c][450] Exit:[SQL_SUCCESS] Environment = 0x14f8160 [ODBC][22407][1379343424.503627][SQLSetEnvAttr.c][182] Entry: Environment = 0x14f8160 Attribute = SQL_ATTR_ODBC_VERSION Value = 0x3 StrLen = 0 [ODBC][22407][1379343424.503654]

“Unable to find component name” on myodbc-installer of driver

落爺英雄遲暮 提交于 2019-12-11 18:47:07
问题 Trying to follow the directions for installing the MySQL ODBC driver. When I try to run: myodbc-installer -a -d -n "MySQL ODBC 8.0 Driver" -t "Driver=/usr/local/lib/libmyodbc8w.so" It says: [ERROR] SQLInstaller error 6: Unable to find component name I've found a handful of cases of people reporting this same message, e.g., here and here. Yet there seems to be no resolution. Noticing the slight variations in the -n name string for the various drivers, I wondered if perhaps the name was

String Parameters not working when using MySql over Odbc

巧了我就是萌 提交于 2019-12-11 02:24:46
问题 I am using Mono/C# with ADO.NET and unixODBC with libmyodbc to connect to a local MySql Server on a x64 Ubuntu Server. The relevant part of /etc/odbcinst.ini: [Default] Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so Connecting using a DSN and querying / updating / inserting works well, with one exception: When I try to use a query with a parameter thats a string in c# and varchar type in MySql, it does not work: the query is executed as if I had passed an empty string as a parameter.

RODBC error - ODBC connection failed - can't connect to MySQL with my mac (mavericks)

狂风中的少年 提交于 2019-12-11 01:38:12
问题 I am trying to connect to a mysql database through R using RODBC on my mac (mavericks) but after a stupid number of hours of effort, I still can't get it working. When I try to connect to a database, RODBC throws this error (error message is so terse, I don't know what it means): ch <- odbcConnect("mydatabasename") "Warning messages: 1: In odbcDriverConnect("DSN=mydatabase") : [RODBC] ERROR: state H, code 0, message [unixODBC][ 2: In odbcDriverConnect("DSN=mydatabasename") : ODBC connection