Click here to Skip to main content
15,888,351 members
Everything / ODBC

ODBC

ODBC

Great Reads

by Bert O Neill
Query Hadoop using Microsoft oriented technologies (C#, SSIS, SQL Server, Excel etc.)
by rev78
Simply bypass the 255 columns in MFC CRecordset
by Amit Kumar Tiwari
.NET to Hadoop connection using Keytab file
by Amund Gjersøe
Visual Studio Query Builder does not work with PostgreSQL when you want to use filtering parameters. This tip show how to make your own "FillBy" methods.

Latest Articles

by Ștefan-Mihai MOGA
About the IntelliDisk app that uses many components published on CodeProject
by rev78
Simply bypass the 255 columns in MFC CRecordset
by WernfriedD
Single .exe to verify if your Oracle Client is properly installed and working. Verify supported technologies for Oracle connection.
by Ștefan-Mihai MOGA
Did you spot any bugs today? Than this tool might save some of your time

All Articles

Sort by Updated

ODBC 

22 Jun 2011 by 2irfanshaikh
Check the link given below:A Fast CSV Reader[^]
1 Mar 2014 by _Asif_
Try thisSetting Up an ODBC Data Source For MS Access[^]
10 Jul 2014 by abdulsafran
I have created C# application using visual studio 2008, I have added some reports from Crystal Reports. For the Crystal Report I have used ODBC connection which created ODBC MySQL. All the reports are generating pertectly in my machine.But, once I clicked the report generate button function...
6 Sep 2011 by Abhinav S
You need to check the query you are using.Debug, get it in a string, and run it in the backend database editor (if possible) to see if it is working.
24 Oct 2022 by Abishek Samuel
I am getting the first character of the output where as I need full text in the output terminal. Output I get: Data Source - E Data Source - M What I have tried: #define NANODBC_USE_UNICODE 1 #ifdef _MSC_VER #define _CRT_SECURE_NO_WARNINGS...
15 Apr 2022 by ahmed_sa
I work on sql server 2017 i add script python to import data to excel but i get error (1 row affected) Msg 39004, Level 16, State 20, Line 0 A 'Python' script error occurred during execution of 'sp_execute_external_script' with HRESULT...
10 May 2011 by AhmedOsamaMoh
Dear all now i was having a problem with UTF8 and my program and the sol was to use ODBC 5.1 instead of 3.5 but now i found new problem when i insert using the following sql commandINSERT INTO users(UserName, PassWord)VALUES (?, SHA1(?))i get ODBC 5.1 error memory...
18 May 2011 by AhmedOsamaMoh
Dear allNow i want a insert function to be added to a tableadpator with following specs: 1. take one parameter ( one datatable which is binded to the DB) 2. to be scalar to be able to return last_insert_id() How this can be done in C# using VS2005 & Mysql I...
22 May 2011 by AhmedOsamaMoh
finalnot to use ODBC and use .Net connect and add in the insert query ; select last_insert_id() as 'xxx' xxx your required id name bye
22 May 2011 by AhmedOsamaMoh
odbc ver. 3 support sha but ver. 5 makes such problem
14 Sep 2015 by AhmedOsamaMoh
dears now i have a huge table with more than 300 column , when i used the following code OdbcDataReader DbReader = DbCommand.ExecuteReader(); DataTable MyTable = DbReader.GetSchemaTable(); i am getting only 255 columns onlywhat should i do??
14 Feb 2013 by Alexey Loire
Heya everyone.I'm stuck while working on my programm.The problem is the following:Preambulae:My app is connecting to the SQL SERVER 2008r2 via ODBC driver and then executes INSERT statement. There're lots of params in it, but i'm stuck with inserting time data. DB has field which needs...
14 Feb 2013 by Alexey Loire
I've found out what caused the problem. Found it in expierence way.The THING that was wrong is:retCode = SQLBindParameter(sqlstatementhandle, 5, SQL_PARAM_INPUT, SQL_C_TYPE_TIME, SQL_TYPE_TIMESTAMP, SQL_TIME_LEN, 0, &Duration, 0, &cbTime);SQL_TIME_LEN - is made by microsoft. by...
11 Nov 2010 by alexvw
Hi everyone,I come to you for some help. I have an application that uses ODBC to query our data warehouse (Teradata), and since the main query (macro) does take a few minutes to complete, I decided to implement multi-threading so that the main thread does not stalls.The secondary thread...
12 Nov 2010 by alexvw
Hi E.F. Nijboer,Thank you for your insight. What you remarked as "instead of:", is almost the exact implementation I had before the issue. Late this afternoon, while explaining the code to a fellow programmer, I realized what voided the multi-thread implementation. Somewhere along the...
7 Jan 2014 by Amirsalgar1
Hello friends ,Can we display image from Database SQL SERVER or Odbc and front end as HTML ?Thanks in Adv :)
7 Apr 2011 by Amit Kumar Tiwari
I think this link http://social.msdn.microsoft.com/Forums/nl-BE/sqldataaccess/thread/c1eed637-1901-4922-a466-d98300f05e8c[^] can help you.
22 May 2011 by Amit Kumar Tiwari
Try solution provided in similar discussion @ http://www.eggheadcafe.com/community/aspnet/14/10045107/vbnet-connection-to-odbc-for-retrieving-data-from-tally.aspx[^]They solved it using DSN connection.
26 Mar 2016 by Amit Kumar Tiwari
.NET to Hadoop connection using Keytab file
15 Feb 2011 by Amund Gjersøe
Visual Studio Query Builder does not work with PostgreSQL when you want to use filtering parameters. This tip show how to make your own "FillBy" methods.
16 Jan 2012 by Amund Gjersøe
I've used the ODBC driver when generating DataSets in Visual Studio 2010 multiple times, but this time it all went wrong. The table in the DB has a set of columns defined as numeric(7,2). I try to insert data through the autogenerated Insert method like this:int x =...
16 Jan 2012 by Amund Gjersøe
Lol, things work in mysterious ways!It turns out that to get the Postgres ODBC driver to work properly I had to read from the table before inserting data into it. In all other applications I did read from the DB as well as write. In my current application I only write, and that was the...
18 Jan 2018 by an0ther1
Ensure you have added references to Crystal Reports as follows; CrystalDecisions.CrystalReports.Engine CrystalDecisions.ReportSource CrystalDecisions.Shared CrystalDecisions.Windows.Forms Add the following using statements; using CrystalDecisions.CrystalReports.Engine; using...
30 Aug 2016 by Andy Lanng
Check your connection string format:MySQL Connector/ODBC 3.51 Connection Strings - ConnectionStrings.com[^]
31 Aug 2016 by Andy Lanng
I'm gonna be pretty anal about this, but your code is very vulnerable. MySQL really doesn't like un-disposed connections.Please change your code as follows://Move your query to a const strin. This is just good practice private const string Query =@"SELECT a.orig_clli, ...
10 Apr 2011 by anilkumar1986
I hope that Your Using Primary key once u delete the primary key and try.And while debugging the application please close the msacess database.
1 Mar 2014 by Aravinth Spirited
I created a table in ms access, and then i wanted to connect it to a java gui front end using type 1 driver. so i tried to create an odbc dsn for access. the test for connection failed while creating the dsn itself. Any suggestions will be extremely helpful, thanks.
18 Apr 2014 by Archie Jacobs
Start with AdvancedHMI. It will let you get the data from the PLC very easily. Then you can write some VB code to store it in a database.
30 Jul 2012 by armagedescu
If you use a debugger, then you will find lots of errors in the code. Also make consistent code, first of all check each return value of SQL* function for success. When you get an error code, then you have to use SQLError function to check more exact information.
5 Aug 2012 by armagedescu
As suggestions. If you return bool then you have to return false/true instead of FALSE/TRUE, because you are not using BOOL. Second, don't name the class Handle. Instead of CConnectionHandle use CConnection name, or even better CDatabase. Instead ir CStatementHandle use CStatement or CQuery, and...
6 Aug 2012 by Arun Kumar K S
Hi,I am creating a cross platform database application using Mono. It uses oracle database as back end. I used ODBC drive to connecting database. I can connect to database using this following connection string in my windows machineDriver={Oracle in...
11 May 2011 by Ashishmau
here is your modifed update statementda.Update(ds.Tables[0].DefaultView.ToTable(true, new string[] { "empName", "salary" }));try with this....
23 Sep 2011 by Asutosha
Hi,I have dot net application which update several table in my database for a single functionality Example (pass file).One button "pass file" is there when I click it do many DML and sql query.For first few click it will work successfully, but after some times it show below...
10 Sep 2021 by ATISH PAI DUKLE
i m trying to develop a dll which will pull data from tally. in vb.net windows application project it runs. But when i use same code to develop a dll which is .netframework 4 build and registered in 64bit .netframework64 folder it gives error as...
21 Jul 2012 by AU Jase
Hi, I would like to know how to determine if the Ace OLEDB Driver is 32 or 64bit installed on the target PC and then tailor the 32 or 64 bit build of my program which writes to excel with OLEDB. Currently on 64 bit office with 64bit ACE I need to change the configuration in visual studio...
21 Feb 2012 by Awadhendra1234
I am making a program in which I established connection with sql server using DSN. I am using ODBCConnection class. I want to check that, DSN which is created is for access or sql server. I did google but not getting helpful information. I am using c# and visual studio 2008.Thanks.
19 Jan 2016 by Badal Kumar
payments table not specified in your from clause.
29 Dec 2011 by Balakrishnan Dhinakaran
Hello Friends I developed a simple mail application in Asp.net(VS 2008) using C# and Database connectivity using ODBC with Sql Server 2005. Actually i developed the entire project in file system. The application run excellent in VS now I want to run the application in IIS 5.0. I also...
13 Dec 2010 by Basnta Padhi
SELECT Count(*) AS counter FROM (select * from table1)WHERE fieldname=valueI think this will help you
23 Sep 2011 by bbirajdar
Make sure that you are releasing the connection objects in your data access layer. If you are running multiple statements in the stored procedure, then seperate them with 'GO'Also try specifying the timeout in the conenction string. Keep the timeout to 10 or 20 minutes.
29 Dec 2015 by Bert O Neill
Query Hadoop using Microsoft oriented technologies (C#, SSIS, SQL Server, Excel etc.)
23 Oct 2012 by Bhaskar Pathak
import java.util.*;import java.io.*;import java.sql.*;public class Stud{ public static void main(String args[]) { try { Class.forName("oracle.jdbc.driver.OracleDriver"); System.out.println("Driver Registered"); Connection connection =...
24 Nov 2010 by Bman232003
I'm trying to extract data from a multi-member file on an AS400. The member resides in /qsys.lib/aplus7fts.lib/rcw@@.file(rcwxx.mbr) within the Integrated File System.Best case scenerio, I would like to retrieve this data via SQL. I have read articles on doing a create alias mylib/myfile for...
3 May 2011 by Bryian Tan
hi,maybe this will helpHow To Programmatically Create a DSN for SQL Server with VB[^]
7 Oct 2018 by bunty swapnil
Hi, We have requirement to pull the Data from Service now source and import it into SQL using SSIS package. And i followed below steps to bring the data. 1.Created DSN in ODBC driver for Service Now Driver 1.0.14. 2.Then Created Linked server in Microsoft SQL Server 2016 (SP2) (KB4052908) -...
25 Oct 2018 by bunty swapnil
Hi, i had developed a package which integrate data from service now source to SQL database. Steps below which i used for integration. 1. Downloaded Service now ODBC driver 1.0.9 and installed. 2.Created DSN for Service now source and Used DatasourceName as Link_Server. 3.Created linked server...
22 Apr 2011 by bzzoy
I recently moved my dev. environment from XP to windows 7 64 bit. We still need to use VS 2003.NET due to old library compatibility, which isn't an issue. I have a Windows Service project which uses an ODBC library we have to connect to a database. Here's where the strange starts...
22 Apr 2011 by bzzoy
Well, I guess I tried every login except my domain account. Setting the service to login as that, I was able to get the connection.edit: I suppose the clear solution is that its a login issue from the service. I am not sure why only the domain account is working at this point, but I have...
4 May 2011 by candice_Blav
I have a code that looks like this that will create a system dsn that has a username and password. It works but when i looked in my created dsn, the login id and password have default values. Hope you'll help me guys.. thanks :)Private Shared Sub CreateSystemDSN() 'create dsn...
15 Jul 2011 by Chief894
Hello guys, I am a software engineering student in APIIT Malaysia and in less than two months I am expected to submit the final year project proposal. But I do not have any idea of what to do as my final year project. I am interested much in front-end graphical user interface design,...
28 May 2013 by CHill60
The default timeout for OdbcCommand is 30 seconds so you will need to override it.See http://msdn.microsoft.com/en-us/library/system.data.odbc.odbccommand.commandtimeout.aspx[^]
3 Sep 2019 by CHill60
Couple of things from a fellow legacy application support type You can still use the column "date", just surround it with square brackets. I.e. update scans1 set [date] = '2019-07-31T00:00:00.000' where id = 21570 I was still getting an error until I changed it toupdate scans1 set [date] =...
4 Feb 2012 by Christian Graus
This looks messy, why can't you just have insert into xxx values(x,y) ?
29 Jul 2012 by Christian Graus
Your code should simply consider every possible input and deal with it. I can't read this code, but, if you look at the line that's blowing up, and what the error is ( is it a null value for example ), then you can write code to check if the value is null ( again, for example, your post is so...
8 Jan 2014 by Christian Graus
I assume by HTML, you just mean, any web platform. Typically, you create a HTTP handler on a URL, which then takes an id, which identifies the image in the DB, reads it out, and returns it to the browser.You sure do not need to buy a library to do this ( like Dynamsoft ), but you will...
21 Jan 2014 by Christian Graus
If you want to use outlook, you need to install outlook. Seems obvious.Here[^] is how to configure that proc, I am not sure you need outlook ?
10 Apr 2011 by cltw666
I'm pulling my hair out on this one. I have a program that access a MDB file using TableAdapter. It was working fine until recently.I am able to write and read the table but when I try to delete a specific line, it does not work. ...
18 Jun 2012 by CodeBoyMatty
I have created a login program in Java. It uses a database with two fields (Username and Password). The program accesses the database and retrieves the records from the two fields. It works on my computer with the ODBC server address being set to 192.168.1.4 and the ports have been opened....
14 Sep 2015 by CPallini
There's the following note in the MSDN documentation[^]:To make sure that metadata columns return the correct information, you must call ExecuteReader with the behavior parameter set to KeyInfo. Otherwise, some of the columns in the schema table may return default, null, or incorrect data.
17 Jul 2012 by D-Kishore
Dear Friends,I had one issue in C# windows application.Here i am working with C# windows applications.My question like, i have one form with two buttons submit & cancel In button click i am staring one thread.The thread contains one stored procedure having the below code...
21 Dec 2017 by DataMig
How To: From MS Access create a ODBC Table Link to DataTable inside a DOT NET APP So the DOT NET APP is like a poor mans SQL Server (or Data Server) The Data is in memory and does not need to be persisted or saved Pointers in the right direction would help Many Thanks In Advance m ...
18 Nov 2010 by Dave Kreskowiak
You know DAO has been deprecated for quite some time now, right? It also won't work on 64-bit Windows.I highly suggest abandoning DAO and switching to OLE DB for using Access databases.Do you have any particular reason for using Access and not going direct to the SQL Server using ? ...
19 Nov 2010 by Dave Kreskowiak
I posted the link to the Roadmap so YOU could pick a technology. Keep in mind, it's entirely likely that Windows 8 will NOT be available in 32-bit. So if your app is going to last that long, you're going to have to rewrite it with something x64 compatible.You could use ADO.NET, but that...
10 May 2011 by Dave Kreskowiak
First, you should be hashing the password in your code, not in the SQL. Why? Because you're transmitting the password "in the clear" between your code and the SQL server. A man-in-the-middle attack can watch the SQL request fly by and yank out the account id and password.You already found...
27 Apr 2012 by Dave Kreskowiak
The connection string is just a string. It's very simple string manipulation to change the server name in a connection string. I would suggest just putting a known tag in the connection string in place of an actual server name. When you want to change the server name, it's a very simple call...
21 Jul 2012 by Dave Kreskowiak
You'll have to write you own SQL statemnet and build the SqlCommand object yourself.The CommandBuilder will NOT build UPDATE query statements from SELECT statements that contains any kind of JOINs.
13 May 2013 by Dave Kreskowiak
You're not explaining the problem and how you expect this stuff to work at all.You need admin priv's because you're writing to HKEY_LOCAL_MACHINE. Normal users cannot do that and there is no way around it.
24 Jan 2016 by Dave Kreskowiak
Your only other option is OleDb, using either the ACE or JET engines depending on the version of the Access database you're trying to get at.
21 Dec 2017 by Dave Kreskowiak
You have to create a provider one of the database drivers installed on the system, such as OLEDB, ODBC, or whatever. THIS IS FAR FROM A TRIVIAL TASK!! The documentation on this subject is very sparse. You can find the start of it here[^]. More on a few samples (NONE OF WHICH ARE VB.NET OR C#!)...
10 Sep 2021 by Dave Kreskowiak
It's possible the Tally driver you're using is 32-bit only. Recompile your .DLL to target x86 instead of x64 or AnyCPU and give that a try.
4 Nov 2013 by DCager
My winform app connects with SQL Server (2008). It uses only Windows authentication at the moment, but I was given a task to allow SQL Server logins also. I am not sure how to test if my code really uses SQL Server login and not Windows login.Is there something I can do here?
18 Jan 2018 by debasish mishra
Invalid character value for cast specification comes from the driver when it detects a string to date time conversion.I urge you to change the data type to a string type or you can tune the logic to ensure that you don't get strings here.
17 May 2012 by debdeep Bhattacharyya
I am using ODBCConnection and trying to get back InfoMessage .. the sql anywhere driver is odbc11.dll. I am not getting the InfoMessage even raised!! Can someone please help! The server is Sybase IQusing System.Data.Odbc;using System;namespace ConsoleApplication2{ class Program...
17 May 2012 by debdeep Bhattacharyya
I am using AsaConnection instead of OdbcConnection. It is provided by Sybase SQL Anywhere inside ianywhere.data.asaclient.dll .. Now I get back the InfoMessage!!
10 Jan 2013 by Deepak Joy Jose
Hi I recently installed MySql Server 5.5 and MySql Connector/Odbc 5.2. Now, my old asp.net which worked perfectly in MySql Server 5.1 and Odbc Connector 3.51 generates an exception upon database operations.The exception generated is: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source...
16 Oct 2011 by Delphi 2005
Hello,I don't know, why your server is slow.Try to reinstall the whole MySQL server, PHP, and Apache server. After uninstalling these, you should restart your computer.It worked once.Best Regards: Delphi 2005
11 Nov 2010 by E.F. Nijboer
What I can imagine is that you already set it to be the datasource of a datagrid (or any other UI component) and because you are updating the data, the UI control halts and waits for completion. With this method it prevents updates while executing an update (or any other action). I think you can...
27 Apr 2012 by ebpzr
I need to connet to database server with different hosts. I will change the host frequently by iteretaing through some data. How can i make the connection string dynamic so that i can change the host name whenever I need.Also the username and password in the connection string is same...
28 Jul 2020 by ekograce
Hi All, I have recently updated my vb.net winform desktop application from framework 4.0 to 4.6.1. I have been using odbc32.dll for my sql server related query. It is no longer working in 4.6.1. It failed in SQLAllocHandle(SQL_HANDLE_DBC, hEnv,...
17 Mar 2014 by elix545
Hi, How to build an ODBC Driver?For example: to query a Text file, XML File and Custom Format File.
19 Jan 2016 by Eranga Gamagedara
I try to extract data using bellow query , it sow this error after execution . please help me to correct this query.Error: #1054 - Unknown column 'payments.date' in 'where clause' My query;SELECT issue.bill_id as 'Bill id', items.i_code as 'Item code', issue.qtt as 'Qtt',...
19 Aug 2012 by Espen Harlinn
Why ask? Create a small test program, and you'll have your answer ... if you run into any problems at that point, feel free to ask here on the forum.You can use one of these CRecordset[^] as a starting point.Best regardsEspen Harlinn
9 Mar 2012 by fordtman
How do I obtain the row count after I execute the statementSQLExecDirect(hstmt, "Select Count(*) as Fred from Table", SQL_NTS);I need to know the number of rows in a table prior to getting the data but I am not sure how the access the result. I am a little confused because the query results...
3 Dec 2015 by FrancoisViljoen
(Not syntactically correct, but shows the point)First step would be to do the following:select item_no, max(created_date) as 'created_date' from itemposts group by item_noNow you have, for every item_no, the date for which you want the itempost record.Once you have that, you...
20 Feb 2019 by Gerry Schmitz
You create 2 connections in your program; one to each server. Query one; then query the other using the results of the first. Of course, this requires thinking beyond "join all". SQL Servers support "distributed queries". You can get to MySQL via ODBC from SQL Server. Linked servers and...
5 Oct 2017 by gilchinger
How to implement a custom ODBC driver using .NET ? Background: For accessing a little bit exotic custom made datasource I'm using some .NET moduls to convert the readonly data to a .NET datatable.The request now is, to make the datasource available as ODBC datasource.The hardcore way...
7 Apr 2011 by gilchinger
Thank you for your replay.I'will check this link.
22 Mar 2011 by grander22
please help me. can someone teach me on what are the codes and where to put them if i where to use mysql as my database, adodb as my codes and vb6 for the interface? or can someone give me a sample project?
19 Dec 2017 by GTR0123
hello guys i am using asterisk and func_odbc so i have problems on stored procedure plz help me out so the problem is like this so this is my func_odbc: [PRESENCE] dsn=concon EXEC dbo.[Check] @Bnum = '${SQL_ESC(${ARG1})}', @Anum = '${SQL_ESC(${ARG2})}' and here is my stored procedure ...
14 Feb 2018 by Gustav Brock
First link a copy of the file, renamed as accdb (or mdb). Then run code to relink to the table(s) from the original file: Public Function Relink() Dim Database As DAO.Database Dim Table As DAO.TableDef Dim Connect As String Set Database = CurrentDb ...
21 Sep 2013 by gxm_ddsr
Use XML to configure a database server
8 May 2020 by hanu009
Hello everyone, I am trying to create an application with ODBC compliant code for DB business logic is in c# DBs to use are oracle 12c and 11g and MSSQL I am using ADO.NET, OLEDB, ODP.NET , ODBC etc. Problem is when i try to use the...
6 Sep 2012 by Harshad-HBK
Hi to all,There is a billing software, have developed in VB6 with Access database.For reports there is configured ODBC on every machine, with centralized database on server.It working fine on all except on in the network.The problem is that this machine needs to configure ODBC again...
18 Jan 2013 by Hasham Ahmad
try this??my $ST=$DB->prepare("call apps.package_name.proc(?, ?, ?)");my ($ST_result, $arg1, $arg2);...$ST->bind_param(1, $arg1);$ST->bind_param(2, $arg2);$ST->bind_param_inout(3, \$ST_result, 0, { ora_type=>ORA_RSET } );$ST->execute();while (my $hr =...
29 Jul 2012 by Ido Hadar
I'm coding a game. (MMORPG) private server.and when I load with command the infomartion of the player (From SQL)Its works perfect.But if I typing worng name. that's the SQL not found at the SQL.Its crashing my game. (The server side)And I just want its say "Error" and wor'nt crsash it...
28 Oct 2020 by inlandchris1
Here is the basic code taken from Microsoft docs. I had the biggest trouble connecting but found out, as you can see, the length of the DSN, username, and password has to be spot on. I will later put the size in a variable to clean it up. I...
28 Oct 2020 by inlandchris1
I have finally found it reading the docs: After you do a fetch, now, get the data from SQLGetData. Works with the output param or input_output param but SP has only an output. AlarmCount has the data (long). retcode =...
17 Oct 2017 by itspaddy
Hi all Using ODBC SQL_OV_ODBC3_80 with SQL Server Native Client 11 driver within a C++ app. Trouble is that several stored procedures have print statements which is breaking the ODBC calls. Is there anyway I can get round this without removing the print statements? Cheers. Found the...
3 Aug 2012 by JackDingler
My advice is to test the code yourself first, to see if it solves the problem you are addressing.I've had little need in the last decade, to do much with the ODBC layer. Using Wizard generated code such as MFC generated classes based on CRecordset, save a lot of time, and perform well enough...
2 Apr 2015 by JammoD87
Hi,I have a legacy Access 97 Frontend application which utilises a SQL Server 2005 backend over a SQL Server ODBC Driver (Connection), we use the Linked Table feature on this setup.I create, amend and link in tables on a daily basis and I am aware of the conversions that occur between...