Click here to Skip to main content
15,879,096 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 Score

ODBC 

29 Dec 2015 by Bert O Neill
Query Hadoop using Microsoft oriented technologies (C#, SSIS, SQL Server, Excel etc.)
21 May 2021 by rev78
Simply bypass the 255 columns in MFC CRecordset
26 Mar 2016 by Amit Kumar Tiwari
.NET to Hadoop connection using Keytab file
21 Jun 2012 by OriginalGriff
Try:SELECT TOP 1 CUST0NO, SYMBOL, POLICY0NUM, MODULE, TYPE0ACT FROM CCC00200 WHERE CUST0NO = ? AND SYMBOL = ? AND POLICY0NUM = ? ORDER BY MODULE DESC
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...
22 Jun 2011 by Prerak Patel
Easiest way,Line 7: strSQL = "SELECT * FROM data.csv WHERE column1 = '" + sDataValue.Replace("'", "''") + "'";Proper way, Use parameterised query.Line 7: strSQL = "SELECT * FROM data.csv WHERE column1 = ?";Line 8: OdbcCommand cmdSelect = new OdbcCommand(strSQL, CsvConn); ...
15 Jul 2011 by OriginalGriff
Talk to your tutors: they will have a better idea of how complex a project you are expected to produce. They may not give you any concrete suggestions, but they may be able to help you focus your mind on your strengths, and what is acceptable as a final year project.
20 Apr 2012 by kimberly wind
try this linkhttp://dotnetslackers.com/articles/sql/Importing-MS-Excel-data-to-SQL-Server-2008.aspx[^]
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.
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...
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...
13 Dec 2010 by Member 3222264
select count(*)As COUNT from table1
14 Aug 2011 by S Douglas
I am not sure about mulit-member objects on the AS400, but I do connect to an AS400 from SQL to extract data. Not sure if this will help but worth a try1) Create linked server, using provider IBM DB2 for i5/OS...2) Under providers, locate the IBMDA400, allow inprocess, set to true3) In...
1 Feb 2012 by Simon_Whale
Have a read of this MSDN article it has VB.NET examplesMSDN: Control.BeginInvoke[^]
21 Jun 2012 by Savalia Manoj M
HI...Try this code... Public Function ReadPolicyStep1(ByVal custnum As String, ByVal symb0l As String, ByVal policynum As String) As DataRow Dim con As OdbcConnection = New OdbcConnection(_connString) Dim cmd As OdbcCommand = New OdbcCommand("SELECT CUST0NO,...
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...
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
4 Jan 2013 by Jan Steyn
You must use the full ODBC call syntax. It also doesn't use named parameters, so you would use a question mark in each param's placecmd.CommandText = "exec Save_Employee ?, ?, ?";if you had 3 parameters.For further...
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 =...
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...
28 Mar 2013 by Maciej Los
All DSN (System and User) are writen in registry. Create DSN using odbcad32.exe[^] application and check registry entry[^];)Here is an example code: See this: https://forums.oracle.com/forums/thread.jspa?threadID=1322637[^]
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[^]
17 Mar 2014 by Sergey Alexandrovich Kryukov
I would call it very, very labor-taking work. Those drivers should be very complicated. I would suggest look at these open-source projects:http://www.unixodbc.org/[^],http://www.iodbc.org/dataspace/iodbc/wiki/iODBC/[^].At the very least, you will be able to see what's involved.See...
2 Jan 2015 by Sergey Alexandrovich Kryukov
First of all, you are applying BETWEEN to strings, but apparently you need to apply it to dates. Please see, for example: http://www.techonthenet.com/sql/between.php[^].Worse, the way you compose your query is wrong from the very beginning. Your query is composed by concatenation with...
19 Jan 2016 by Badal Kumar
payments table not specified in your from clause.
11 Dec 2017 by Leo Chapiro
Try to use CDatabase Class[^] : // This fragment is taken from the declaration for CMyDatabaseDoc // CMyDatabaseDoc is derived from CDocument. public: // Declare a CDatabase embedded in the document CDatabase m_dbCust; m_dbCust.OpenEx(_T("DSN=MFC_ODBCTest;UID=JOES"));
13 Dec 2017 by Jochen Arndt
The keyword is C/C++ pointer arithmetic. The first parameter of the AfxMessageBox() function is an LPCTSTR string pointer. You are passing the address of a constant string and adds the value "5" (myNode.m_Identifiant_Noeud is as primary key probably some kind of int). So the message box shows...
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] =...
8 May 2020 by RickZeeland
Take a look at Best-orms-for-c[^] And this CodeProject article: VITA – A Powerful and Flexible ORM and Additional Building Blocks for .NET Applications[^] If you don't want to use an ORM, take a look at: Don't Hard Code Your DataProviders[^]
28 Jul 2020 by OriginalGriff
You cannot mix 32 and 64 bit components in the same application. You will need to either find a 64bit version of you DLL, or compile you app to 32 bits to use it.
24 Oct 2022 by Richard MacCutchan
SQLCHAR * driverDesc[256]; // both of these are character arrays (assuming you fixed driverDesc) SQLCHAR dsnName[256]; SQLDataSources(henv, // from the below casts I am guessing that this function returns wide characters. ...
8 Nov 2010 by Werner.Gunter
hi there,could anyone PLEASE point me in a direction where i might find a generic, ready to use (configuring source & target details) web service which would query an odbc data source and produce an xml dataset?i need it for dynamically updating an xcelsius dashboard, and am really not...
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...
18 Nov 2010 by Sulan
Hi,I have got a strange behavior within a c++ application. It connects through DAO to an Access 2010 database. The Access database has got its tables linked to a SQL Server 2008 through ODBC.When I run a particular query, containing a BETWEEN-statement, on one table before running...
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...
23 Nov 2010 by Manfred Rudolf Bihy
Hello Prateek,your problem is with the SQL insert statement:insert into Friends values (First_Name,Last_Name,Address,ContactNo,EMailID,RegistrationDate) values(?,?,?,?,?,?)"The first "values" is wrong. The list of fields is seperated by comma and enclosed in parehthesis. It's the...
9 Dec 2010 by mr.abzadeh
I need to get column names of a table in ODBC oe OLE DB programatically.Which functions or methods should I use?
13 Dec 2010 by Basnta Padhi
SELECT Count(*) AS counter FROM (select * from table1)WHERE fieldname=valueI think this will help you
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.
21 Feb 2011 by Member 4326501
All,I have written a small interface application running on the Timberline server that migrates read only data from TL to Sql Server 2008 through the ODBC drivers. No UNC paths, just local paths for the TL setup. The application will run for days, sometimes weeks(every 1/2 hour). THEN, I...
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?
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 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.
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.
11 Apr 2011 by Wendelius
Few options come in mind:- if (hopefully) you're using transactions, ensure that the transaction gets committed and is not rolled back.- if the MDB is included into your project, check that you're not using the file from bin/debug (or equivalent) directory. If you use the file from there, it...
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...
22 Apr 2011 by Kim Togo
Perhaps a firewall is in place and block connection to MySQL tcp port 3306 ?Is the MySQL and your program running on the same computer?Can't connect to [local] MySQL server[^]Another thing, take a look at the managed MySQL database connector and skip ODBC.Download Connector/Net[^]
22 Apr 2011 by Prasanta_Prince
1. Make sure you have installed the .Net Framework on your server 2. Download the ODBC .Net data provider and install it on your development machine or your server. You can download it here:...
23 Apr 2011 by Pratik Bhesaniya
Refer below it will help you,Link1[^]Link2[^]
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...
3 May 2011 by Bryian Tan
hi,maybe this will helpHow To Programmatically Create a DSN for SQL Server with VB[^]
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...
10 May 2011 by Kim Togo
Skip ODBC driver for MySql and download MySql Connector/Net[^] native C# driver.And use MySqlParameter for the job. Do as Dave suggests. Do hashing before INSERT statement.
11 May 2011 by Wayne Gaylard
When it comes to SQL queries you should never use SELECT * FROM test.csv, rather name the columns you want to extract by name. Thus if you do thisvoid RefreshData() { OdbcConnection conn = new OdbcConnection(@"Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=C:\;"); ...
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....
18 May 2011 by suren.info
what if you put your insert query in an SP and return that latest autogenerated id from the procedure.
18 May 2011 by Ramalinga Koushik
What have you tried for this in Insert Query and what is the Output it got Generated based on your Stored Procedure.
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...
19 May 2011 by sridharan28
Hi All,I want to fetch the data from tally and put it into csv format by using .net.How can I connect my .net application into tally odbc.I knew about the rtslink dll.But it not having information about odbc connectivity.Please help me in this.Thanks in Advance.
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
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.
14 Jun 2011 by sandeepnayathil
How to connect from mfc application in visual studio 2008 to an odbc databse(sql Anywhere version 12)please give the connection codethanks in advance
21 Jun 2011 by Slacker007
You say that your Access 2007 db is protected? Please elaborate on what you mean by "protected".If the ODBC connection is set up properly, it should run smoothly. I don' usually run into problems in performance with my ODBC connections.You will have to create an ODBC DSN connection on...
22 Jun 2011 by 2irfanshaikh
Check the link given below:A Fast CSV Reader[^]
27 Jun 2011 by sam_ckp
hi, its very easy, go thru this linkshttp://www.academictutorials.com/vc-plus/mfc-database-classes.asp[^]http://www.pspt.fi/virtuaaliamk/etr/odbc/sivu9.htm[^]
16 Jul 2011 by thatraja
Here you go, look at those answers(Some answers contains links to external sites).Project topic for mca[^]
16 Jul 2011 by RaviRanjanKr
Go there-[Project List based on Java][^] for getting 41 topics which will might help you.
19 Jul 2011 by Mr. Tomay
I have created an SDI project with ODBC support using the class wizard.In my database file (MS Access ".mdb"), there are some fields with type "OLE Object".To bind the db columns with the app record-set data members, the class wizard has choosed to bind db "OLE Objects" with record-set...
14 Aug 2011 by Rajni from delhi
Hi.m creating a oledb connection in my website.and opening a connection of it..but when i deploy my website on a server .. then m getting this error.Microsoft jet oledb 4.0 provider is not registered on the local m/c.MSOffice is n't installed on my server m/c.plz tell me .. wht...
14 Aug 2011 by OriginalGriff
The chances are that you are running a 64 bit OS and compiling for a 64 bit target. Unfortunately, there is no 64 bit version of the Jet engine - nor is there likely to be - so you must either:1) Switch to 32 bit target development.2) Switch to a different database engine.
6 Sep 2011 by Kay Andrian Fikar
Hello Everyone...I have a problem creating a very simple database application using ODBC in visual studio 2008..I started with dialog based application, and add manually a ODBC consumer wizard and i found problem when i checked the "Binding All Column" check box. after pressed OK, visual...
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...
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.
26 Sep 2011 by Mr. Tomay
I have created an SDI application with ODBC support linked to Microsoft SQL Server 2000 (MSDE 2000) Service Pack 4.It is working perfectly on my computer.1) I want to know how to make it a distributable application to an end-user, assuming that he is not an expert of ODBC administration...
26 Sep 2011 by sachin10d
1. You will have to give detail ODBC settings document to end-user2. we can make database in the same directory of the application at the time of database creation 3. yes log files are necessary.
9 Oct 2011 by vrushali katkade
I have a simple table with 3 records in it. Doing a select * from table with ODBC isextremely slow, on the magnitude of 20 seconds or more.how to improve the speed of the MYSQL ODBC 3.51 driver in windows XP?
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
13 Dec 2011 by Member 8044422
Hi Team,In our project, we are using ODBC driver for connecting oracle database.When we are running the application in Windows 7 Professional Edition, It is showing an error that [Microsoft][ODBC Driver Manager]Data source name not found and no default driver specified.We are using a...
13 Dec 2011 by seravan
If you're using .NET try looking into .NET Framework Data Provider for Oracle inhttp://connectionstrings.com/oracle[^][Standard]Data Source=MyOracleDB;Integrated Security=yes;[Specifying username and password]Data Source=MyOracleDB;User...
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...
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...
1 Feb 2012 by ZurdoDev
dataGrid.Refresh();
4 Feb 2012 by vrushali katkade
i have used the odbc to excute the query.i have attached the access(.mdb) database to the dsn then used the following query insert into SCRIPT (ID1, NM ) select '10' as DTID1 , 'DD' as DTNM Union All select '20' as DTID1 , 'DRR' as DTNM Union All select '30' as DTID1 , 'DDD'...
4 Feb 2012 by Christian Graus
This looks messy, why can't you just have insert into xxx values(x,y) ?
6 Feb 2012 by Soner Aydemir
Hello,I'm trying to import data into Microsoft PowerPivot from MySQL database. I have created a connection by using OLE DB provider. I've tested the connection, and it succeeded. However when I import the tables from the database, it gives an error below:The following system error...
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.
22 Feb 2012 by The Doer
Go to control pannel-->Administrative tools-->Data Source(ODBC)-->select any 1( user/System/file) -->here u can see the number of DSN that already exists-->click on configure button--> here u can see either ur DSN is created for access or SQL or Excel or any other..u can also change the...
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...
10 Mar 2012 by Sergey Alexandrovich Kryukov
Please see my question in a comment to the question. Apparently, if you don't get data at all, you have no data, so the question does not make complete sense.You have a command, now you can create either System.Data.SqlClient.SqlDataReader or System.Data.SqlClient.SqlDataAdapter out of it....
13 Apr 2012 by tharre
Hello all, I've written a program that has worked well on 32 bit machines but, I have found that on W7 the application puts the driver in the wow5624 directory for the ODBC. I can access and find the data source but when I try to do a connect I get an error message something like, cannot find...
13 Apr 2012 by Kuldeep B
Hi Tharre...1)Download AccessDatabaseEngine_x64.exe fromhttp://www.microsoft.com/download/en/details.aspx?id=13255[^]2)Uninstall MS Office from your Machine.3)Install AccessDatabaseEngine_x64.exe.4)Install MS OfficeThen try your application.May this help you.Enjoy...
13 Apr 2012 by tharre
Hi Kuldeep,Guess I wasn't clear enough. The application that created an ODBC placed it's ODBC into the SysWOW64 directory. I have written code that can retreive the Data Source from the 64-bit registry but when I use the name it cannot find the source because the vb program seems to be...
16 Apr 2012 by tharre
Hello all,Well, I've run into a road block and could use some ideas. I built a program that looks at a SQL Anywhere database 9.0. It has worked fine under XP or windows 7 as long as the DB is in the 32bit ODBC directory. As the application that creates the database, not mine, puts it...