Classes for direct SQL calls with ODBC - 项目摘要 |
摘要
| 管理 |
论坛 文档
| 软件包 |
|
|
|
项目描述: |
The main class for doing this is CSQLDirect. CSQLDirect has the following attributes/functions:
CSQLDirect::Connect - Connects to a datasource.
CSQLDirect::ExecuteSQL - this is the main function that is used for handling the SQL statement.
CSQLDirect::GetCol - Will return a column from a table in the resulting cursor.
CSQLDirect::GetError - Provides detailed error messages in case something went wrong.
CSQLDirect::GetColumnType - Provides information about a cursor's column.
CSQLDirect::Fetch - Will properly execute a SQLFetch command with error handling.
CSQLDirect::Close - Closes the connection to the datasource.
The other class CSQLColumn is a support class for CSQLDirect. Since multiple queries to a cursor's column will result in a NULL value being returned, I found it necessary to keep track of the columns as they are used. This is stored in a CPtrArray within CSQLDirect and is cleaned up after each time the cursor is requeried/closed.
通过ODBC直接调用SQL的类
这项工作的主函数是CSQLDirect。CSQLDirect函数具有以下的属性/功能:
CSQLDirect::Connect - 连接数据源
CSQLDirect::ExecuteSQL - t这是处理SQL声明的主要函数
CSQLDirect::GetCol - 返回光标处的一个记录
CSQLDirect::GetError - 当有错误发生时,提供详细的出错信息
CSQLDirect::GetColumnType - 提供一个关于光标所在栏的信息
CSQLDirect::Fetch - 合适的处理一个错误的SQL指令
CSQLDirect::Close - 关闭与数据源的连接
另外了一个类 CSQLColumn支持CSQLDirect类 。 因为对鼠标所在位置的多项查询,容易导致控制的返回。我发现必须跟踪所使用的栏。这个被保存在CSQLDirect中的CPtrArray中,并且在每次光标被调用或关闭时被清空。  
来源: http://www.codeguru.com/mfc_database/direct_sql_with_odbc.shtml |
类别: |
|
发布者:
cbd002
|
|
最新发布源码包 |
软件包 |
版本号 |
日期 |
本地下载 |
direct_sql_with |
 1.0  |
2004-04-18 |
下载 |
|
|