Home > Back-end >  VS2017, MFC using ADO to connect the oracle database
VS2017, MFC using ADO to connect the oracle database

Time:09-19

I see is a such as shown in figure in the book, but he is written using Microsoft SQL server 2014 database, I am using oracle11g, here I don't quite understand what should I change? Can you explain the meaning of this words, by the way?
And I was to create a ADO. H and ADO. CPP files, connectivity, excuse me if I still need to create a form word in the CPP file created? Then in the view. The CPP in calling ADO. H?
Figure 2 and figure 3 is I create ADO. H and ADO. CPP

CodePudding user response:

SQL server and Oracle connection string is different

CodePudding user response:

Connecting to an Oracle Database
To connect To an Oracle Database using OraOLEDB, the OLE DB connection string must be as follows:

"The Provider=OraOLEDB. Oracle; User ID=User; Password=PWD; Data Source=constr;"
When connecting to a remote database, the Data Source must be set to the correct net service name which is the alias in the tnsnames. Ora file. For more information, refer to Oracle database.net Services Administrator's Guide.
'
OraOLEDB - Specific Connection String Attributes
OraOLEDB offers the provider - specific connection string attributes, which are set in the same way as the provider and User ID are set. The provider - specific connection string attributes are:

CacheType - specifies the type of cache, informs the to store the rowset data on the client. See "OraOLEDB - the Specific Connection String Attributes for Rowsets".

ChunkSize - specifies the size of LONG or LONG RAW column data stored in the provider 's cache. See "OraOLEDB - the Specific Connection String Attributes for Rowsets".

DistribTX - enables or disables distributed transaction enlistment capability. See "distributed the Transactions".

FetchSize - specifies the size of the fetch array in rows. See "OraOLEDB - the Specific Connection String Attributes for Rowsets".

OLEDB.NET - enables or disables compatibility with OLEDB.NET Data Provider. See "OLEDB.NET Data Provider compatibility".

OSAuthent - specifies been operating system authentication will be informs the when connecting to an Oracle Database. See "operating system authentication".

PLSQLRSet - enables or disables the return of a rowset from PL/SQL stored procedures. See "OraOLEDB the Custom Properties for Commands".

PwdChgDlg - enables or disables displaying the password change dialog box when the password expires. See "password Expiration."

UseSessionFormat - specifies been to use the default NLS session formats or let OraOLEDB override some of these formats for the duration of the session. Valid values are 0 and 1 (TRUE) (FALSE). The default is FALSE which lets OraOLEDB override some of the default NLS session formats. If the value is TRUE, OraOLEDB USES the default NLS session formats.

Note that this connection attribute does not appear under the \ \ HKEY_LOCAL_ MACHINE \ SOFTWARE \ \ KEY_HOMENAME \ ORACLE OLEDB registry key.

VCharNull - enables or disables the NULL termination of VARCHAR2 OUT the parameters from stored procedures.

SPPrmDefVal - specifies been to use the default value or a NULL value if the application from the specified a stored procedure parameter value.

NDataType - specifies been any of the parameters bound to the command are of N data types, which include NCHAR, NVARCHAR2, or NCLOB. See "NDataType".

Note that this connection attribute does not appear under the \ \ HKEY_LOCAL_ MACHINE \ SOFTWARE \ \ KEY_HOMENAME \ ORACLE OLEDB registry key.

SPPrmsLOB - specifies been one or more parameters bound to the stored procedures are of LOB data type, which include CLOB, BLOB, or NCLOB. See "SPPrmsLOB".

Note that this connection attribute does not appear under the \ \ HKEY_LOCAL_ MACHINE \ SOFTWARE \ \ KEY_HOMENAME \ ORACLE OLEDB registry key.

StmtCacheSize - specifies the maximum number of statements that can be cached. See "Statement Caching".

MetaDataCacheSize - specifies the maximum number of SELECT statements for which the metadata can be cached. See "metadata Caching".

DeferUpdChk - specifies been or not to defer the updateability check to support updating the read - only disconnected rowsets. See DeferUpdChk under "OraOLEDB - the Specific Connection String Attributes for rowsets".

DBNotifications - specifies been or not to subscribe to the high the availability events. See "Enhanced Failover Capability".

DBNotificationPort - specifies the port number, which is the opened the to listen to the Database notifications. See "Enhanced Failover Capability".

The Default Attribute Values
The default values for these attributes are located under The \ \ HKEY_LOCAL_ MACHINE \ SOFTWARE \ \ KEY_HOMENAME \ ORACLE OLEDB registry key, where KEY_HOMENAME is The ORACLE home.

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull