Solved

Using Visual C++ to connect to DB2 DATABASE

Posted on 2004-04-16
4
433 Views
Last Modified: 2013-11-18
Can Visual C++.Net be used to connect to a DB2 database to create tables and do inserts and deletes?  Will I need any additional software/plugins etc?
0
Comment
Question by:blackula24
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Expert Comment

by:MarkBordelon
ID: 10848869
Hi, I am quite new at this and therefore a novice at best so please take this with a grain of salt.  I am trying to learn how to do the same thing with an Access .mdb file.  In Visual C++.net, you can use the oleDbDataAdapter to connect to certain databases.  For a disconnnected application, which appears to be where the world is heading due to resource limitations, when you drop the adapter to a form and go to configure it (Press New Connection, then select the Provider tab), there are quite a few providers from which to choose.  For Microsoft Access, it is Microsoft Jet 4.0 OLE DB Provider.  I am not familiar with most of the others (although I reconize some of the more commone ones such as Oracle and SQL) nor am I familier with DB2, however, if you look there you may recognize that one of them will serve as the adapter for which you are looking.  For Microsoft Access, you have to configure this adapter (setting the path to your database file and then pressing the "Test" button to ensure that the link was established.  Once you have this set up, drop and OleDbConnection object to the form.  This will actually connect to the database (as my understanding).  Finally, drop a dataset object to the form.  The dataset object will be used as a storage queue to hold "snapshots" of the dataset that you query from your database using SQL statements. This dataset can hold data from multiple tables without actually using inner joins (not sure if there are such things in DB2 but these do exist in Microsoft Access).  To view the data, you can drop a grid onto the form and use the Fill method to populate it.  
I have gotten this far but do not know the syntax to write the data (after I have made edits in my grid on the form) back to the dataset, and then finally, back to the table(s) in the database in which this infomation is stored.  If you have any information on that I'd appreciate it.
Well, I hope this helps, and apoligize if this is redundant information.  Good luck.
Mark B.
0
 
LVL 7

Accepted Solution

by:
leflon earned 250 total points
ID: 10948307
hi  blackula24,

for C++.Net and DB2 you may take a look at

DB2 Database Project for Visual Studio .Net:
http://www-106.ibm.com/developerworks/db2/library/techarticle/0304alazzawe1/0304alazzawe1.html

DB2 and Visual Studio .NET
http://www-106.ibm.com/developerworks/db2/zones/vstudio/

leflon
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
memorymap in visual studio 3 72
I want Video to play on Mobile Device without going fullscreen 8 175
Recommend web chat service 1 173
Resolve Dependency Issues 4 99
I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question