odbc

How to pass SSIS variables in ODBC SQLCommand expression?

久未见 提交于 2019-11-27 08:23:51
问题 I'm trying to load incremental data from ODBC server to SQL server using common table expression. When running the query in the Dbeabver application, is executed correctly: with test as ( SELECT userid,sum(goldbalance) FROM Server.events_live where eventTimestamp>=DATE '2016-01-01' + INTERVAL '-100 day' group by userid order by sum(goldbalance) desc) ) select * from test when running it from an sql command expression of the ODBC source, it fails due to wrong syntax. It looks as follow: with

Why am I getting “Data source name not found and no default driver specified” and how do I fix it?

[亡魂溺海] 提交于 2019-11-27 08:09:31
问题 When trying to make a program on Windows that connects to a database via ODBC, I got the following error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. I'm sure my code is right. It even worked on a different PC. Why am I getting this error? And How do I fix it? 回答1: What causes this error? The error message tells you, simply put, that the ODBC Driver Manager could not find the driver you specified in your connection string or DSN. This can have

SQL Server ODBC Driver not raising errors

断了今生、忘了曾经 提交于 2019-11-27 08:00:15
问题 This question is part in a series of bugs in the Microsoft ODBC driver: ODBC driver fails to raise errors; but instead suppresses them Reading columns out of order returns incorrect results Cannot execute a stored procedure that is a SYNONYM Microsoft has said they will not be fixing these bugs in their ODBC driver. Background If i have a sample table: CREATE TABLE Wallet ( WalletID int NOT NULL, Name varchar(50) NOT NULL ) i attempt to issue sql that inserts into the table without specifying

Check if a SQL table exists

南楼画角 提交于 2019-11-27 07:33:48
What's the best way to check if a table exists in a Sql database in a database independant way? I came up with: bool exists; const string sqlStatement = @"SELECT COUNT(*) FROM my_table"; try { using (OdbcCommand cmd = new OdbcCommand(sqlStatement, myOdbcConnection)) { cmd.ExecuteScalar(); exists = true; } } catch { exists = false; } Is there a better way to do this? This method will not work when the connection to the database fails. I've found ways for Sybase, SQL server, Oracle but nothing that works for all databases. Michael Buen bool exists; try { // ANSI SQL way. Works in PostgreSQL,

Linux odbc Fatal error: Allowed memory size

断了今生、忘了曾经 提交于 2019-11-27 07:14:02
问题 I currently have some problems to set up an intranet with an odbc link beetween an AS400 (iseries V6R1) and a Debian I use the iseriesAccess7.1 odbc driver 64bits, unixODBC2.3.1 and php5.4 with unixODBC support. My link seems to be good because I can connect to my DataBase using the isql command (which is part of unixODBC) and execute some SQL queries but it's impossible to read records in the database using a php script. When I try to launch a little script on my intranet I get the following

PHP & SQL Server - field names truncated

时光总嘲笑我的痴心妄想 提交于 2019-11-27 06:35:02
问题 Here is the relevant code: function connect(){ // DB credentials and info defined here.... $connection = odbc_connect("DRIVER={SQL Server Native Client 11.0}; Server=$server; Database=$db;", $loginname, $loginpass); return $connection; } function odbc_fetch_results($stmt, &$results) { $numrows = odbc_num_rows($stmt); $row = odbc_fetch_array($stmt); print_r($row); // Prints: Array ( [MEASUREMENT_UNI] => kg) if($row){ $results = array ($row); while( $row = odbc_fetch_array($stmt)){ array_push(

Accessing Access over JDBC (using ODBC?)

南楼画角 提交于 2019-11-27 06:22:17
问题 I'm looking for a way to open an Access MDB file inside a Java App (using JDBC). A quick Google Search suggests that I need the JDBC-ODBC Bridge for this... Does this mean that I need to configure every system I want to run my app on to provide a ODBC DSN for the MDB I want to open? And one more question (since I've never used ODBC before): will the communication happen over some sort of a socket (in a client/server-style), or through method/function calls (like with an embeded Derby db)? 回答1

How To Convert An Elixir Binary To A String?

六月ゝ 毕业季﹏ 提交于 2019-11-27 05:56:35
问题 So I'm trying to convert a binary to a string. This code: t = [{<<71,0,69,0,84,0>>}] String.from_char_list(t) But I'm getting this when I try this conversion: ** (ArgumentError) argument error (stdlib) :unicode.characters_to_binary([{<<70, 0, 73, 0, 78, 0>>}]) (elixir) lib/string.ex:1161: String.from_char_list/1 I'm assuming the <<70, 0, etc. is likely a list of graphemes (it's the return from an API call and the API is not quite documented) but do I need to specify the encoding somehow? I

Creating a DSN-less connection for MS Access within Java

筅森魡賤 提交于 2019-11-27 05:47:59
问题 I'm building a desktop app that needs to communicate with a MS Access database. Now, unless I want to register the DSN for the database on every computer that's going to use the desktop app, I need a way to connect to the database in a DSN-less fashion. I've searched alot and found some useful links on how to create connection strings and based on that I tried modifying my program based on that but without success. The code below fails. If i switch the string in the getConnection to "jdbc

How do I change a Crystal Report's ODBC database connection at runtime?

落花浮王杯 提交于 2019-11-27 04:52:54
I have a report made with Crystal Reports 2008 that I need to deploy a production system which means that I need to be able to change the database connection at runtime. The database is PostgreSQL 8.3.0 and the connection I use for creating the initial report is an ODBC connection. I have found various ways to change the database connection including the following: reportDoc.Load(report); reportDoc.DataSourceConnections[0].SetConnection("server", "database", "user", "pwd"); reportDoc.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, path); However, this always fails with