odbc

Linked SQL Server database giving “inconsistent metadata” error

最后都变了- 提交于 2019-11-30 13:45:54
问题 I am currently running a third-party software suite, which uses SQL Server as its database. I have a second instance of SQL Server running in a different location, and some apps that I am building in that instance SQL Server needs to access some data in the third-party software. So, I created an ODBC connection between the boxes, and set up the third-party SQL server as a linked server on my version of SQL Server. As a test, I ran something like the following statement from my SQL server,

Character encoding issue with PDO_ODBC

拜拜、爱过 提交于 2019-11-30 13:25:38
问题 When accessing a Microsoft SQL Database from PHP using PDO_ODBC with the following code, I have an encoding issue. When outputed the text from the DB is garbled. $dsn = "odbc:DRIVER={SQL Server};SERVER=$hostname;DATABASE=$database;charset=UTF-8"; $pdo = new PDO($dsn,$username,$password); $sql = "SELECT text FROM atable"; $result = $PDO->query($sql); while($data = $result->fetchObject()){ $values[] = $data->text; } dpm($values); (source: bayimg.com) This is done from a Drupal module.

What's the Option=N in the MySQL ODBC connection string?

女生的网名这么多〃 提交于 2019-11-30 11:51:02
I have seen both Option=3 and Option=4 in connection string samples for MySQL ODBC but no explanation or documentation. What do those numbers mean? scatman The Option= value is the sum of the numeric values for various flags that specify how Connector/ODBC should work. Its default value is 0. From an older version of the Connector/ODBC documentation at web.archive.org : Option=3; corresponded to FLAG_FIELD_LENGTH (1) + FLAG_FOUND_ROWS (2) Option=4; was FLAG_DEBUG According to the current list of Connector/ODBC options here ... Table 5.2 Connector/ODBC Option Parameters ... both FLAG_FIELD

Get Number of Rows from a Select statement

心不动则不痛 提交于 2019-11-30 11:44:01
I have this: $dbh = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=$mdbFilename", $username, $password); $sql = "SELECT * FROM this_table"; $stmt = $dbh->query($sql); //num of rows? How do I get the number of rows returned from that SELECT statement? Thanks all Leniel Maccaferri SELECT count(*) FROM this_table is an option... Regarding rowCount: PDOStatement::rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement executed by the corresponding PDOStatement object. If the last SQL statement executed by the associated PDOStatement was a

Reading Netezza database table from C# via ODBC not working in Windows 7

百般思念 提交于 2019-11-30 10:36:44
Why can't .NET connect to my Netezza box via the installed {NetezzaSQL} driver? 64bit applications also cannot connect via this ODBC connection. Why would that be? I've built both user and system Netezza ODBC connections in Control Panel, and both work fine when I click "Test Connection"? I see the value in the registry, but when I traverse the registry drivers, .NET does not see "NetezzaSQL". According to Netezza, they don't have a 64 bit ODBC driver. The driver they provide should work for 32 and 64 bit applications. Could this be a permissions issue perhaps with Windows 7? static void

Reverse Engineering for Database Diagramming in Visio with SQL Server 2008

江枫思渺然 提交于 2019-11-30 10:33:55
问题 I need to reverse engineer a Microsoft SQL Server 2008 in order to create a Microsoft Visio 2007 Database Model Diagram. So I choose "Reverse Engineer" from the Database menu to connect to the DB. I configured the Microsoft SQL Server Visio driver so that is uses SQL Server Native Client 10.0 as the ODBC driver. Afterwards I created a User DSN which connects to my DB. This DSN works (at least the provided test is successful). After clicking next in the Reverse Engineer Wizard, Visio kindly

Exception on loading JDBC-ODBC driver

≯℡__Kan透↙ 提交于 2019-11-30 09:51:40
问题 I am getting java.lang.ClassNotFoundException on loading sun.jdbc.odbc.JdbcOdbcDriver using Class.forName() . I am using MySQL as Data Source and I have added Data Source Name in ODBC Data Source Administrator (on Windows 8). Here is the code: class Connect { check() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch (ClassNotFoundException e) { e.printStackTrace(); } } } Output: java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver 回答1: Are you using Java 8? The class is

Is there a difference in the underlying protocol for ODBC, OLEDB & ADO.NET

六眼飞鱼酱① 提交于 2019-11-30 09:49:28
When communicating to a SQL Server database using one of the typical systems, ODBC, OLEDB or ADO.NET, is the underlying basic protocol the same? Are all the differences between these systems basically just client side issues? Is this all just different flavors of TDS (Tabular Data Stream) transfer? [MS-TDS]: Tabular Data Stream Protocol Specification Or there actual different ways to talk to the database server and there are fundamental difference between these protocols? ODBC, OLE DB and ADO.NET are different API/frameworks for communicating with the database. For example, ADO works on data

Connecting to an MSSQL database from a Ruby on Rails application running on Ubuntu

≯℡__Kan透↙ 提交于 2019-11-30 09:41:08
I have a situation where I'm trying to build a web app which takes a total count of records in a table and outputs it to the screen. Sounds simple right...? The main problem I'm having is that the DB I want to look at is MSSQL. I haven't set up this kind of DB connection from Rails before so I was hoping someone could point me in the right direction. My RoR application will live on a Ubuntu server (and is being developed on a OSX Leopard system). EDIT: I should clarify that the MSSQL DB is running on SQL server 2005 and is on a windows server environment. I tried checking out the wiki

Using pyodbc cause error: Data source name not found and no default driver specified

余生长醉 提交于 2019-11-30 09:05:29
问题 I'm using pyodbc to connect SQL Server. I had created connection string like this: from sqlalchemy import Table, Column, databases, Integer, String, ForeignKey, create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import session engine = create_engine('mssql+pyodbc://sa:123@localhost/TrainQuizDB') engine.connect() TrainQuizDB is database name that I created in Sql Server. For more information I have windows 8.1 64bit and I installed python version 3.5.1