ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaik_5.4.0.1/rzaikodbcprogexamples.htm

94 lines
6.4 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="ODBC program examples" />
<meta name="abstract" content="The following ODBC programming examples demonstrate simple queries, and accessing and returning data by calling stored procedures. C/C++, Visual Basic and RPG programming language versions are provided." />
<meta name="description" content="The following ODBC programming examples demonstrate simple queries, and accessing and returning data by calling stored procedures. C/C++, Visual Basic and RPG programming language versions are provided." />
<meta name="DC.Relation" scheme="URI" content="rzaikappodbc.htm" />
<meta name="DC.Relation" scheme="URI" content="rzaikodbcviscex.htm" />
<meta name="DC.Relation" scheme="URI" content="rzaikodbcvbex2.htm" />
<meta name="DC.Relation" scheme="URI" content="rzaikodbcrpghostex.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1999, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1999, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="odbcprogexamples" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>ODBC program examples</title>
</head>
<body id="odbcprogexamples"><a name="odbcprogexamples"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">ODBC program examples</h1>
<div><p>The following ODBC programming examples demonstrate simple queries,
and accessing and returning data by calling stored procedures. C/C++, Visual
Basic and RPG programming language versions are provided.</p>
<div class="section"><p>IBM<sup>®</sup> grants
you a nonexclusive copyright license to use all programming code examples
from which you can generate similar function tailored to your own specific
needs.</p>
<p><img src="./delta.gif" alt="Start of change" />SUBJECT TO ANY STATUTORY WARRANTIES WHICH CANNOT BE
EXCLUDED, IBM,
ITS PROGRAM DEVELOPERS AND SUPPLIERS MAKE NO WARRANTIES OR CONDITIONS EITHER
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OR
CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT,
REGARDING THE PROGRAM OR TECHNICAL SUPPORT, IF ANY. <img src="./deltaend.gif" alt="End of change" /></p>
<p><img src="./delta.gif" alt="Start of change" />UNDER
NO CIRCUMSTANCES IS IBM, ITS PROGRAM DEVELOPERS OR SUPPLIERS LIABLE FOR ANY
OF THE FOLLOWING, EVEN IF INFORMED OF THEIR POSSIBILITY: <img src="./deltaend.gif" alt="End of change" /></p>
<img src="./delta.gif" alt="Start of change" /><ol><li>LOSS OF, OR DAMAGE TO, DATA;</li>
<li>DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES, OR FOR ANY ECONOMIC
CONSEQUENTIAL DAMAGES; OR </li>
<li>LOST PROFITS, BUSINESS, REVENUE, GOODWILL, OR ANTICIPATED SAVINGS.</li>
</ol><img src="./deltaend.gif" alt="End of change" />
<p><img src="./delta.gif" alt="Start of change" />SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION
OF DIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, SO SOME OR ALL OF THE ABOVE
LIMITATIONS OR EXCLUSIONS MAY NOT APPLY TO YOU.<img src="./deltaend.gif" alt="End of change" /></p>
</div>
<div class="section"><p>Note that many of the C/C++ samples are not complete programs.
For complete discussions and programming samples, refer to the following locations: </p>
<p></p>
<ul><li>To access ODBC programming samples (Visual Basic, C++, and Lotus<sup>®</sup> Script
programming environments), link to the <a href="ftp://testcase.software.ibm.com/as400/fromibm/ApiSamples/" target="_blank">IBM ftp site</a><img src="www.gif" alt="Link outside the Information Center" /> on the Web. Select <strong>index.txt</strong> to
see what programming examples are available and to download to your PC).</li>
<li>For information on Stored Procedures and examples on how to call them
see <a href="rzaikodbcstoredproc.htm">Stored procedures</a> .</li>
<li>Search for ODBC samples in Microsoft's MSDN library or ODBC webpage.
Examples can be found for Visual Basic, ADO, and C/C++.</li>
<li>The C programming example in the Programmer's Toolkit</li>
</ul>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rzaikodbcviscex.htm">Example: Visual C++ - Access and return data by a call to a stored procedure</a></strong><br />
This example illustrates using Visual C++ to access and return data by a call to a stored procedure.</li>
<li class="ulchildlink"><strong><a href="rzaikodbcvbex2.htm">Example: Visual Basic - Access and return data by a call to a stored procedure</a></strong><br />
Visual Basic is able to call external functions that are found
in DLLs. Since all ODBC drivers are DLLs, Visual Basic can be used to code
directly to the ODBC APIs. By coding directly to the ODBC APIs a Visual Basic
application can call an iSeries™ server stored procedure and return result
values.</li>
<li class="ulchildlink"><strong><a href="rzaikodbcrpghostex.htm">Examples: RPG - Host code for ODBC stored procedures</a></strong><br />
In this example, the program, <strong>SPROC2</strong>, is called from the
client as a stored procedure via ODBC. It returns data to the client from
the PARTS database file.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzaikappodbc.htm" title="A common database interface that uses SQL as its database access language. iSeries Access for Windows provides an ODBC driver to support this interface.">iSeries Access for Windows ODBC</a></div>
</div>
</div>
</body>
</html>