⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.html

📁 vc在线考试系统源码
💻 HTML
字号:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="Author" content="Reghu">
   <meta name="GENERATOR" content="Mozilla/4.7 [en] (WinNT; I) [Netscape]">
   <title>ReadMe</title>
</head>
<body>

<h1>
<b><u><font face="Arial,Helvetica"><font color="#000099">Passing LOB Parameters
From And To A Stored Procedure</font></font></u></b></h1>

<p><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Contents of this
document:
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#1.Overview of the Sample">Overview
of the sample</a>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#Required Software">Required
Software</a>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#Assumptions">Assumptions</a>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#Description of  files in the sample">Description
of&nbsp; files in the sample</a>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#5. Prepare and Run the Sample">
Prepare and Run the sample</a>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#Steps followed in the sample">Steps&nbsp;
in the sample</a>
<h2>
&nbsp;<a NAME="1.Overview of the Sample"></a><font face="Arial,Helvetica"><font color="#000099">Overview
of the Sample</font></font></h2>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This sample shows how
to pass LOB parameters to&nbsp; and from&nbsp; Oracle stored procedure
using Oracle Provider for OLEDB and ActiveX Data
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Objects
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ADO) with VC++.&nbsp;
It also demonstrates that Oracle provider for OLEDB bypasses PL/SQL limitation
of parameter size greater 32K to a
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; database&nbsp;&nbsp;
procedure.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; With OraOLEDB, for
passing the LOB variables as parameter to a SQL statement or stored procedure,
the property 'SPPrmsLOB' is to set to
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; true to tell the provider
that a LOB parameter is being passed .
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The property can be set to
true as ADO command object property just before executing the command and
then set to false.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The sample shows how to set
the 'SPPrmsLOB' property with command object.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Note : The maximum size of image
that can be passed as&nbsp; OUT parameter to stored procedure with OraOLEDB
is 64K. Images greater than this
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
size may&nbsp; not be&nbsp; retrieved properly from database.
<br>&nbsp;
<h2>
&nbsp;<a NAME="Required Software"></a><font face="Arial,Helvetica"><font color="#000099">Required
Software</font></font></h2>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Oracle 8x database .
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Visual C++ 6.0
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Oracle Provider for
OLEDB Release 8.1.7
<br>&nbsp;
<h2>
&nbsp;<a NAME="Assumptions"></a><font face="Arial,Helvetica"><font color="#000099">Assumptions</font></font></h2>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1. A database user
e.g.. Oraole with password Oraole has already been created.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2. The tables
with data used by the sample have already been created using the SQL scripts.
Refer db8setup.html for more information about
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
setting up the database tables and populating data.
<br>&nbsp;
<h2>
<font face="Arial,Helvetica"><font color="#000099">&nbsp;<a NAME="Description of  files in the sample"></a>Description
of&nbsp; files in the sample</font></font></h2>
&nbsp;
<table BORDER COLS=4 WIDTH="100%" >
<tr>
<td WIDTH="4%">
<h4>
<font face="Arial,Helvetica"><font color="#000099">Sr No</font></font></h4>
</td>

<td WIDTH="10%">
<h4>
<font face="Arial,Helvetica"><font color="#000099">File Name</font></font></h4>
</td>

<td WIDTH="10%">
<h4>
<font face="Arial,Helvetica"><font color="#000099">Type</font></font></h4>
</td>

<td>
<h4>
<font face="Arial,Helvetica"><font color="#000099">File Description</font></font></h4>
</td>
</tr>

<tr>
<td>1</td>

<td>&nbsp;ReadMe.html</td>

<td>HTML File</td>

<td>ReadMe File for the project</td>
</tr>

<tr>
<td>2</td>

<td>ADODBHandler.h</td>

<td>C++ header file</td>

<td>Declares the class for handling database functions.</td>
</tr>

<tr>
<td>3</td>

<td>ADODBHandler.cpp</td>

<td>C++ source file</td>

<td>Contains implementation of the class for handling database functions.</td>
</tr>

<tr>
<td>4</td>

<td>LOBSample.h</td>

<td>C++ header file</td>

<td>This is the startup file for the implementation. It contains declaration
of class derived from CWinApp</td>
</tr>

<tr>
<td>5</td>

<td>LOBSample.cpp</td>

<td>C++ source file</td>

<td>Implementation file for class used to start up of the application</td>
</tr>

<tr>
<td>6</td>

<td>LOBSampleDlg.h</td>

<td>C++ header file</td>

<td>This file declares the class for start up dialog box of the application</td>
</tr>

<tr>
<td>7</td>

<td>LOBSampleDlg.cpp</td>

<td>C++ source file</td>

<td>This file contains the class implementation for start up dialog box.</td>
</tr>

<tr>
<td>8</td>

<td>Image.h</td>

<td>C++ header file</td>

<td>This file contains the declaration of class for drawing and displaying
the image on the dialog box.</td>
</tr>

<tr>
<td>9</td>

<td>Image.cpp</td>

<td>C++ source file</td>

<td>This file contains the implementation of class for drawing and displaying
the image on dialog box</td>
</tr>

<tr>
<td>10</td>

<td>LOBSample.rc</td>

<td>Resource script file</td>

<td>This file contains definition of application resources</td>
</tr>

<tr>
<td>11</td>

<td>Resource.h</td>

<td>C++ header file</td>

<td>This file defines the constants for the resources used by the application</td>
</tr>

<tr>
<td>12</td>

<td>ConnectionParams.h</td>

<td>C++ header file</td>

<td>This file contains connection parameters to connect to particular database.&nbsp;</td>
</tr>

<tr>
<td>13</td>

<td>StdAfx.h</td>

<td>C++ header file</td>

<td>This includes standard system include files or project specific include
files that are used frequently, but&nbsp;&nbsp; are changed infrequently</td>
</tr>

<tr>
<td>14</td>

<td>StdAfx.cpp</td>

<td>C++ source file</td>

<td>This is source file that contains the standard includes</td>
</tr>

<tr>
<td>15</td>

<td>StoredProcedure.sql</td>

<td>SQL script file</td>

<td>This file contains the sql script to create the&nbsp; stored procedures&nbsp;
required by the&nbsp; sample.</td>
</tr>

<tr>
<td>16</td>

<td>res/LOBSample.rc2</td>

<td>Resource script file</td>

<td>Resource file</td>
</tr>

<tr>
<td>17</td>

<td>res/LOBSample.ico</td>

<td>Image file</td>

<td>Icon file</td>
</tr>

<tr>
<td>18</td>

<td>LOBSample.dsp</td>

<td>&nbsp;Project file</td>

<td>VC++ Project file</td>
</tr>

<tr>
<td>19</td>

<td>LOBSample.dsw</td>

<td>Workspace file</td>

<td>VC++ workspace file</td>
</tr>

<tr>
<td>20</td>

<td>LOBSample.clw</td>

<td>CLW file</td>

<td>Contains class wizard information of the project</td>
</tr>

<tr>
<td>21</td>

<td>imageG30.jpg</td>

<td>Image File</td>

<td>Used by ReadMe.html</td>
</tr>

<tr>
<td>22</td>

<td>imageHHP.jpg</td>

<td>Image File</td>

<td>Used by ReadMe.html</td>
</tr>

<tr>
<td>23</td>

<td>imageJ3S.jpg</td>

<td>Image File</td>

<td>Used by ReadMe.html</td>
</tr>
</table>

<h3>
&nbsp;</h3>

<h2>
&nbsp;<a NAME="5. Prepare and Run the Sample"></a><font face="Arial,Helvetica"><font color="#000099">Prepare
and Run the Sample</font></font></h2>
<font face="Arial,Helvetica"><font color="#000099">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

</font></font>1.&nbsp; Extract the Sample files.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Unzip VCADOLOBSample.zip&nbsp; using Winzip or command utility
<br>.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
2<font color="#000000">.&nbsp; Connect to Oracle Sql*plus using &lt;username>/&lt;password>@&lt;connectstring>
.</font>
<br><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Here &lt;username> refers to the user in which all the tables have been
created and &lt;password> refers to the password given for the above</font>
<br><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
user .&lt;connectstring> refers to the&nbsp; hostname.</font>
<p><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
3. Make sure that you have created the database tables required by this
sample.Refer db8setup.html for more information about setting up the</font>
<br><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
database tables and populating data.</font>
<p><font color="#000000"><font face="Arial,Helvetica">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>
4<font face="Arial,Helvetica">.</font>&nbsp; Create Database Stored Procedure
by running StoredProcedure.sql script.</font>
<br><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
SQL> @&lt;path>StoredProcedure.sql</font>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5.&nbsp;
Open LOBSample.dsw using VC++ 6.0.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6.&nbsp;
Edit connectionParams.h&nbsp; file to change the database connection parameters
i.e. database name, user name and password
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
to database you want to use . Save the file.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7.&nbsp;
Build and Run the sample.
<br>&nbsp;
<h2>
&nbsp;<a NAME="Steps followed in the sample"></a><font face="Arial,Helvetica"><font color="#000099">Steps
in the sample</font></font></h2>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.&nbsp; Select
product from the list. Its corresponding image should appear in the Existing
Image frame.
<center>
<p><img SRC="imageHHP.JPG" height=600 width=576></center>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
fig 1
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
2.&nbsp; To select another image for update, click on "Browse " button,
a File Open Common Dialog appears.
<center>
<p><img SRC="imageG3O.JPG" height=601 width=576></center>

<p><br>
<br>
<br>
<br>
<br>
<br>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.&nbsp; Once the image from the File
Open Common Dialog Box is selected it appears in the new image frame.
<center>
<p><img SRC="imageJ3S.JPG" height=602 width=576></center>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4. "Update Image" button
can be pressed to update the product image in the database
<p>
<hr WIDTH="100%">
<p><b>Please enter your comments about this sample in the OTN Sample code
discussion forum.</b>
<br>&nbsp;
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -