FAQ Database Discussion Community


Connecting to Oracle DB in Go

windows,oracle,go,odbc
I am trying to connect to Oracle DB from Windows (64 bit Go, 32 bit client) I already reffered this question but I am completely new to Go so I am clueless about the configuration he suggested. I have installed multiple clients, such as: 1. `code.google.com\p\odbc` 2. `github.com\mattn\go-oci8` I tried...

Invalid descriptor index on LAST_INSERT_ID after insert

mysql,c,odbc
Strange situation with my ODBC code ( called from a C library ). Basically, I have the following sequence of events: Create insert statement ( just a string ) Call SQLPrepare with that insert statement string Bind the various parameters ( column values ), using SQLBindParameter Call SQLExecute to insert...

How to get a list of all database names in FileMaker pro using ODBC C#

c#,odbc,filemaker
I am working on an application to extract data from FileMaker pro using ODBC, I successfully get data from a specific table now try { conn = new OdbcConnection("DSN=FileMaker;Uid=Admin;Pwd=******"); conn.Open(); cmd = new OdbcCommand("SELECT * FROM SimpleProductTest"); cmd.Connection = conn; dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); if ((dr != null) && (dr.HasRows)) {...

Cannot fetch result from a variable in update query

php,sql,odbc,sybase-ase
I'm using odbc to execute queries to Sybase ASE and fetch the results to screen in my PHP code. What I'm trying to do: declare @status char(6) set @status = 'false' UPDATE table SET field = 'newvalue', @status = 'true' select @status as status I'm getting the result using this...

Access ODBC can't pull from SQL table with more than 255 columns

sql,ms-access,odbc,ms-access-2013
I have a database that I'm trying to query from Access with ODBC. The table I need to read from has 304 columns, and I can only see the first 255 in the Query Builder. I've read elsewhere that the solution is to write an SQL query by hand rather...

64-bit SQLGetStmtAttr writes 8 bytes to value buffer when returning SQLUINTEGER

c++,sql-server,odbc,32bit-64bit
I'm surprised by what I'm seeing in this block of code: SQLUINTEGER uiCursorType; SQLINTEGER iLength; SQLRETURN sSQLReturn; sSQLReturn = SQLGetStmtAttr( shStmtHandle, SQL_ATTR_CURSOR_TYPE, &uiCursorType, SQL_IS_UINTEGER, &iLength); I was initially tipped off that a problem may exist here because when the containing function returns, the Visual Studio (remote) debugger tells me that...

Connecting to ODBC using pyODBC

python,ms-access,odbc,pyodbc,dsn
I've read all the faq pages from the python odbc library as well as other examples and managed to connect to the DSN, using the following code: cnxn = pyodbc.connect("DSN=DSNNAME") cursor = cnxn.cursor() cursor.tables() rows = cursor.fetchall() for row in rows: print row.table_name but for everything else I keep getting...

QODBCResult::exec: Unable to execute statement: "[Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error

c++,sql-server,qt,tsql,odbc
I get this error when I try to call stored procedure in QT using QODBC: QODBCResult::exec: Unable to execute statement: "[Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error Amount of parameters is correct, syntax looks alright to me. The procedure executes fine in Management Studio. What might be the...

Dapper using ODBC store procedure Input parm always promt @XXX was not supplied

odbc,dapper
I need help from All Dapper master. I have been learning using Dapper since one month ago, but I have error when executing query using ODBC SP. The code originally was written by someone(DapperExample) but not using ODBC, thanks to the writer I forgot your name. My SP: CREATE PROCEDURE...

PHP Prepared Statement variable binding error with subquery

php,sql-server,odbc
I have a query with a few subqueries like so SELECT ... FROM (SELECT ... FROM ... GROUP BY ...) as speedLimitCalc INNER JOIN (SELECT ... FROM date a INNER JOIN HOURLY_TEST b ON a.[FULL_DAY_DT] = b.DATE WHERE (b.DATE BETWEEN '".$date_s."' AND '".$date_e."') AND HOUR BETWEEN ".$time_s." AND ".$time_e." AND(LKNO...

Updating ODBC database in ASP.NET C#

c#,asp.net,odbc
im a newb here just wanted to know is there any way to edit a single column of data within the database in ASP.NET c# using ODBC without having a unique id or sort to locate the exact column within the database?? Thanks.

How to insert data to a sqlite database with table name as variable

mysql,sql,sqlite,jdbc,odbc
I would like to insert data into my sqlite data base but with a variable as the name of the table where the data should be entered. try { Random rand = new Random(); uniqueID = rand.nextInt(9998) + 1; //Generates a random number from 1 - 9999 inclusively String dateStart...

How to extract and store ODBC with driver pairs

c#,odbc
I have an application that extracts all ODBC connections from the computer and puts them in a combo box. The user then chooses an ODBC connection out of the combo box and supplies the user name and password to then use to connect to the database. I have been able...

Connecting with MS Access Data source from java code

java,jdbc,odbc
I have created a .mdb file using MS Access. I have created a User DSN in windows. now i want to connect to this data source using java code ? how can i do that ?

Setting an ODBC connection string in VBA

excel,vba,odbc,connection-string
I have created a macro that sends a new CommandText to an ODBC Connection in my Excel spreadsheet and then refreshes the table of results associated with the query. This has been working fine, but I've noticed that each time I run the macro it overwrites the connection string with...

ODBC ISAM_EOF without any reason

c#,database,odbc,cobol
I have a strange behavior with an ODBC Driver and the underlying COBOL database. The database driver is acuODBC of AcuCorp(now Microfocus), the database itself is a COBOL database. The DSN is a system DSN and works just fine. Via Access/Excel u can read/write data with the DSN successfully. In...

SAS libname odbc, how to access a two-level name table

odbc,sas
I recently found the libname statement is very handy to access tables reside in odbc. But I don't know how to access those tables having a two-level names. Below is an example. Old code I use (this code works): proc sql; connect to odbc(dsn=edw_nz user=&username. pw=&password.); create table test select...

RODBC - Value does not fit into a numeric

sql,r,odbc,netezza
Hello and thanks in advance. I have an ODBC connection to a Netezza database using RODBC and I'm trying to write a data frame to a database table. I keep getting the following error: HY000 46 ERROR: Numeric overflow. Value does not fit in a numeric(10,10) Which I don't understand...

Error connecting to MSSQL using PHP

php,sql-server,pdo,odbc,sqlsrv
I am receiving an error as below: PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[08001]: [Microsoft][ODBC Driver 11 for SQL Server]SQL Server Network Interfaces: Connection string is not valid [87]. ' My codes are as follow: $this->link = new PDO( "sqlsrv:server=$this->serverName:$this->port;Database=$this->db", "$this->uid", "$this->pwd" ); I wish someone can enlighten...

Proper way to use a database class

c#,database,odbc
I've been searching for this for a little while now and cannot seem to find a way to accomplish my goal. First, what I'm currently trying to code is a ticketing app for our IT department to use, mostly to help us keep track of what has and hasn't been...

Connect to SQL server from PHP via odbc connection with Windows authentication

php,sql-server,windows,odbc
I'm trying to connect to a local SQL server from a PHP srcipt using odbc_connect, but I can't log in. This is my code so far: $user= "PC_NAME\PC_USER"; $password=""; $dsn = "Driver={SQL Server};Server=MyServer;Database=MyDatabase;Integrated Security=SSPI;Persist Security Info=False;"; $link = odbc_connect("$dsn", $user, $password); Can you see anything wrong?...

ODBC INSERT/UPDATE statements trigger internal server error (500)

php,odbc
I am currently building a PHP site, which has to connect to a data source via an ODBC connection. The data source is not common and the driver was supplied by the customer (and no, they don't know how it all works :) ). I was able to successfully connect...

VB.net 2008 Oracle update within a transaction only commiting part

vb.net,oracle,transactions,odbc
We are having a funky issue, we have vb.net app which is getting an updateable data reader via a select Query into oracle. We use ODBC for connections. We have two tables F4201 and the f4211 the 01 table is header and the 11 is detail. We have an update...

How can I connect to Server 2008 via ODBC in PHP?

php,sql-server,odbc
I have a remote server running IIS7 and SQL Server 2008 which I'm trying to connect to via ODBC in a PHP script: $server = "server_ip"; $database = 'db'; $user = 'user'; $password = 'pass'; $conn=odbc_connect("Driver={SQL Server};Server=$server;Database=$database;", $user, $password); if( $conn ) { echo "Connection established.<br />"; }else{ echo "Connection...

dispose or use the keyword “using” [duplicate]

c#,odbc
This question already has an answer here: Uses of “using” in C# 25 answers .NET: Using using blocks vs. calling .Dispose() 9 answers Do I really need to use comm.Dispose() and conn.Dispose() or directly used the using? using (OdbcConnection conn = new OdbcConnection()) { conn.Open(); OdbcCommand comm = new...

OdbcCommand with parameters doesn't return anything

c#,mysql,.net,odbc
I have the next code: public static List<T> ExecuteQuery<T>(string qry, Dictionary<string, object> parameters = null) { using (var connection = new OdbcConnection(ConnectionString)) { connection.Open(); var command = new OdbcCommand(qry, connection); if (parameters != null) { foreach (var parameter in parameters) { command.Parameters.AddWithValue(parameter.Key, parameter.Value); } } using (var reader = command.ExecuteReader())...

Large select query hangs using Python and unixODBC connecting to SQL Server

python,sql-server,odbc,pyodbc,unixodbc
We have to run a number of large select queries against SQL Server from CentOS 6 boxes. On two servers, when using a pretty bland select statement, the rate of data returned from SQL Server starts fast before slowing down and receiving bursts of data every ~30 seconds. On two...

Use OdbcDataAdapter to select timestamp values

c#,oracle,timestamp,odbc,dataadapter
I'm trying to fill a DataTable from an Oracle database using an OdbcDataAdapter (Driver=Microsoft ODBC for Oracle). The basic code is like this (minus functional OdbcConnection, instantiated DataTable, try and catch statements, etc.): string queryString = "myquerystring" OdbcDataAdapter adapter = new OdbcDataAdapter(queryString, odbcConnection); adapter.Fill(dataTable); My problem is that the Fill()...

PHP 5.5 and MSSQL driver: Installing ODBC Driver 11 in Windows Server 2012 R2

sql-server-2012,odbc,windows-server-2012,php-5.5,iis-8.5
I have a Windows Server 2012 R2 with IIS 8.5, and another server with MSSQL 2012. I must install PHP in IIS and connect to MSSQL, and I don't have Internet available for Web PI. I managed to install PHP 5.5 and I'm able to run phpinfo(), and I also...

Can you use odbc_connect() on openshift?

odbc,openshift
In openshift this code <?php $connection = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$mdbFilename", $user, $password); ~ returns PHP Fatal error: Call to undefined function odbc_connect() Can you use odbc_connect() on openshift?...

Switching from ODBC to OLEDB and getting “Object Required”

vba,vb6,odbc,oledb
I have been tasked with modifying some VBA code to switch from using an ODBC connection to using an OLEDB connection so we can just code a username and password into a subroutine. I'm certainly not experienced with this but I think I'm managed to get the proper connection string...

How to use the ODBC 64 bit to read the excel file in Windows 7 64 bit machine

excel,java-ee,jdbc,odbc
I need to read the excel file through ODBC 64 bit in my windows 7 64 bit machine. By default in my system there are two odbcad32 [32-bit] C:\Windows\SysWOW64\odbcad32 (It contains the microsoft excel driver) [64-bit] C:\Windows\System32\odbcad32 (It doesn't have the microsoft excel driver) Since, the system doesn't have...

Database structure possibility

php,sql-server,database,codeigniter,odbc
I have a question about databases and I'm using active recordsCodeigniter. The logic is like this: I have a table, let's say its name is A, table A has 4 fields, such as: uniqueID, typeofID, date, and userID. First step: I (user) do validation with table A with condition uniqueID...

SQLGetInfo - How to use this function

c#,database,odbc,oledbconnection,dsn
I have developed a c# application which connects to many types of database servers like Sql,Oracle,Mysql etc..Connection was established using ODBC. I need to find the server type (DBMS type) for which the connection was established, as the user only enters the DSN name. After several hours of surfing, I...

unable insert jpeg into filemaker db with pyodbc : HY011 ODBC Error

python,odbc,filemaker,pyodbc,unixodbc
I get this odbc error by trying to insert a JPEG into a FileMaker 14 database. When i run the same script against a MySQL for inserting a blob, there's no error. Inserting a text field does not produce an error. Also i have no clue and cannot find a...

Aginity for Netezza Create Temp Table from external xlsx file using ODBC

sql,odbc,temp-tables,netezza,import-from-excel
In Aginity Workbench for Netezza, I am trying to create a temp table from a .XLSX file containing 13 columns but only need columns 1 and 5. I can export to tab delimited .TXT with only the two columns needed and it works fine, but I would like to avoid...

ODBC php Excel Encoding Issues

php,excel,encoding,utf-8,odbc
I'm making an ODBC connection with php to an Excel file. However when I encounter characters like "~", "^", "´" they appear messed up as this: Mês -> M?s Formação -> Forma??o I'm doing the following utf-8 treatment just to get the column names: $con = odbc_connect($odbcName, $dbUser, $dbPassword) or...

New Datastax driver for Tableau is not working

cassandra,odbc,tableau,datastax
trying to run Tableau on top of DSE 4.7. It fails. I can't do something in worksheet or preview the data. Get this error: "Missing EOF at 'tablename_i_try_to_query' " What is the right way to fix it?...

How to know ODBC driver to which RDBMS connect?

odbc
I need away to Know the ODBC driver to which RDBMS (SQL or ORACLE) connect through c# code ? I used odbcObjectname.driver property this property get the name of the ODBC driver specified for the current connection. If the odbcObjectname.driver = "sqlncli11.dll" I know that the driver connect to SQL...

Datagridview : row moves after an update, why?

.net,vb.net,postgresql,datagridview,odbc
I make an application in vb.net code using the visual basic 2010 environment and i have a little problem whith the datagridview. For more details, i have connected a postgresql database using the connector odbc and it work fine. I can insert, update, delete datas easily but after an update...

ODBC login is trying to use Windows authentication even though I supply SQL Server credentials

java,sql,jdbc,odbc,jdbc-odbc
I am having trouble connecting to my Microsoft Server 2008 using the JdbcOdbc driver in Java. I prefer to use the Jdbc driver over the windows driver as the client has multiple options to connect with. The connection string I am using is: jdbc:odbc:Driver={SQL Server};SERVER=hostname;database=CadSysDB;user=sqlusername;pass=sqlpassword;} The server does not make...

Unable to retrieve UTF-8 accented characters from Access via PDO_ODBC

php,ms-access,pdo,utf-8,odbc
I am trying to get an Access DB converted into MySQL. Everything works perfectly, expect for one big monkey wrench... If the access db has any non standard characters, it wont work. My query will tell me: Incorrect string value: '\xE9d' If I directly echo out the rows text that...

C++ [ODBC]-MSSQLExpress 2008 SQLSTATE: 28000 || 42000

c++,sql,windows,sql-server-2008,odbc
I'm facing some issues trying devloping a program that has to get informations from database and tables created under MSSQL 2008 management. I have to admit that I'm new to ODBC... If anyone could help me with this issues? I tried two solutions to connect to my database [CodeA] and...

CRecordset::GetFieldValue exception “GetFieldValue operation failed on field …” in c++ multithreading

c++,sql-server,odbc
I am getting an exception "GetFieldValue operation failed on field ..." when calling GetFieldValue() function with CRecordset instance. It works fine with single thread, but causes error only with multi-threading. The following statements are being used. Any help? To open the database: CDatabase dbhandle; dbhandle.OpenEx(dsn.c_str(), CDatabase::noOdbcDialog); To execute query and...

ODBC Data Source Administrator - missing tcp/ip for installed driver

db2,odbc
When I open the ODBC Data Source Administrator (32-bit) to configure it for DB2 connections, I try to add a System DSN, and then add a DB2 database alias. The issue is that when adding the alias, the CLI/ODBC Settings don't show a TCP/IP tab so that I can enter...

Is there a more efficient way to execute this nested SQL query?

sql,ms-access,odbc,subquery,correlated-subquery
I am writing a query to fill a select box on a user form and it works fine but when I look at the SQL, I feel like there should be a better, more efficient way to write it. Notice the two nested SELECTs below are from the same table....

Junk varchar entries in MSSQL database using ODBC

c++,sql-server,c++11,odbc
I'm trying to insert a string-variable into a varchar(100)-field, but if the string is longer than 15 elements only junk is inserted (e.g. "0‰?"). First my setup: Development: Win7 (64bit) / VS2013 / C++11 / 64bit Application Database: Win8 (64bit) / Microsoft SQL Server Express 2014 (64bit) Driver: SQL Server...

call db2 load statement from an odbc connection

import,load,db2,odbc,wizard
I have this txt file, formatted with the '|' character between columns, and this script generated by the db2 LOAD wizard: LOAD FROM "<path_and_name_of_the_txt_file>" OF DEL MODIFIED BY ANYORDER COLDEL| METHOD P (1, 2, 3) MESSAGES "<path_and_name_of_a_new_log_file>" REPLACE INTO DB2ADMIN.WEB_NOHAB_CONSOLI (RUC, RAZSOC, FECHA) NONRECOVERABLE INDEXING MODE AUTOSELECT LOCK WITH FORCE;...

Java JDBC-ODBC cannot load driver for Excel

java,excel,jdbc,odbc
import java.sql.Connection; import java.sql.DriverManager; public class ConnectionExample { public static void main(String args[]) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch (Exception e) { System.out.println("JDBC-ODBC driver failed to load."); return; } try { Connection con = DriverManager.getConnection("jdbc:odbc:abcdefg", "", ""); con.close(); } catch (Exception e) { System.out.println(e); } } } This code always...

Access denied to database for user when connecting to mysql from vbscript

mysql,vbscript,odbc
I have this code in a vbscript... ConString = "Provider=MSDASQL;Driver={MySQL ODBC 5.3 ANSI Driver};Server=192.168.0.5;" &_ "Database=EWS;User=EWSimportUser;Password=xxxxxxx;Option=3;" set conn = CreateObject("ADODB.Connection"): conn.open ConString My script fails at the set conn line with the following error message... Error: [MySQL][ODBC 5.3(a) Driver]Access denied for user 'EWSimportUser'@'192.168.0.%' to database 'EWS' I know this user...

Free PHP and MySQL Web hosting

php,mysql,web,odbc,web-hosting
I am currently looking for a FREE PHP and MySQL web hosting site. I used to use 000webhost but I ran into a problem with that, I made a small program in c# and wanted it to access the database but whenever it tried to connect to it, I recieved...

How to use connection string in ODBC to create a table in Access permanently linked to a SQL source?

sql-server,access-vba,odbc,ms-access-2007
I have created a table in my Access front end application, and try to connect it to the back end database with the following subroutine: Sub createFlowTable() Dim db As Database Dim tblDef As TableDef Set db = CurrentDb Set tblDef = db.CreateTableDef("myTable") tblDef.Connect = "ODBC;DRIVER=SQL Server;SERVER=myServer; Trusted_Connection=No;UID=<myUID>;PWD=<myPWD>;APP=2007 Microsoft Office...

LogParser SQL Server driver windows 2012 x64

sql-server,odbc,windows-server-2012-r2,logparser
I have a logparser one liner which outputs in a SQL Server database. I had a conversion problem between logparser timestamp and SQL Server date(7) types. I resolved this issue by specifying the driver -driver "sql server native client 10.0" Here is the whole oneliner : LogParser "select to_date(to_timestamp('2015-03-13','yyyy-MM-dd')) AS...

Join two tables in MSSQL and only return rows with a certain value in a field

php,sql,sql-server,join,odbc
I have two tables that I am trying to join with a column called "job_id". The first table, "Commitments", contains information about project details, the second table, called "Jobs" contains details about the project managers assigned to a job. I want to join the two together and return all the...

what is the SQL prepared stament for lo_import in postgreSQL

c++,sql,database,postgresql,odbc
In postgreSQL we have option to import the file into database using lo_import method, which returns a OID using that we can export the file from database to the filesystem. eg: describe test table name text, file_id oid insert into test values('arul_test',lo_import('/home/arul/test.txt')); prepared statement would be insert into test values(?,?);...

Segmentation Fault from PHP PDO FreeTDS ODBC execution

php,sql-server,pdo,odbc,freetds
I am currently migrating a PHP project from using PHP's mssql library to using the PDO library with FreeTDS. I have modified all of my database calls, but have run into a very strange problem executing the prepared statements on the SQL Server database. Below is a snippet of code...

How to determine what type of database - Old legacy corporate database

sql,database,oracle,odbc,top-n
I have access to a legacy corporate database that I can connect to via Microsoft's ODBC for Oracle driver through Visual Studio 2010. Can I query the database to determine what type and version the database is? Also, will the Microsoft ODBC for Oracle driver ONLY connect to Oracle servers,...

C# read attachments from Access .accdb

c#,ms-access,odbc
I have to read a table from .accdb file and migrate it to a database. I can't install MS Access on the server where the migration will be executed! Currently I use ODBC OdbcConnection DbConnection = new OdbcConnection("DSN=SAMPLE_ISAM"); DbConnection.Open(); OdbcCommand DbCommand = DbConnection.CreateCommand(); DbCommand.CommandText = "SELECT Attachments FROM SomeTable"; OdbcDataReader...

odbc_fetch_array not observing AS

php,sql-server,odbc
I am using ODBC to connect to MS SQL server from PHP (5.5). Development is done on Windows 8.1, while production is CentOS 7. CentOS uses UnixODBC. Connection works fine on both system, with the exception of AS not being observed on the Linux machine. Example: SELECT CustomerID AS CustomerNumber...

Access passthrough query to Oracle without VBA

oracle,ms-access,odbc
Is there any way to send a passthrough query to Oracle from Access, and have Oracle return the record set without using the Jet engine or VBA? I need to execute a query against a view and not have Access process the WHERE condition. I'd prefer to stay away from...

Edit fields in local table linked to PassThrough Query

sql-server,ms-access,odbc
I have been tasked to create a query that will pull records from Data Warehouse with a given criteria that will be used by data-entry level employees with read only access. Once they have used the query to identify a record that requires action in a different system, we would...

Connecting to Peachtree database using php?

php,odbc,pervasive-sql
Iam developing an application in php which can fetch transaction,invoices.etc from peachtree database. So for database access I selected ODBC method by connecting using Pervasive SQL. I used connection string like this:- $connection = odbc_connect("DRIVER={Pervasive ODBC Engine Interface};Dbq=C:\Sagepro\Peachtree\Company\Sample\PAW\BCS","Peachtree","password"); But it is giving error ( ! ) Warning: odbc_connect() [function.odbc-connect]: SQL...

How to use ODBC to connect to any DBMS

odbc
I'm developping a java application and i'm using JDBC to connect to MySQL Database, now i want to use ODBC to be able to get and retrieve data from any DBMS, of course if have access to it. Is there an API or tool to do this ?