CDatabase::Open和OpenEx有什么不同之处。
解决方案 »
- 如何用radio控制button的disabled属性?
- 请问怎样获取CStatic控件的背景,以及把背景存为bmp文件
- 关于两个类之间的数据访问
- ■■■ 急急急 -> NTFS 分区创建 Everyone 属性文件夹 怎样添加 高级》权限项目》应用于》该文件夹,子文件夹及文件
- 关于智能指针的问题,望指教!!!
- 请问各位前辈,如何把一个文件以二进制形式存入MS SQL Server数据库的某一个字段里?
- 如何通过动态库导出其中各个函数的调用方式
- 两个帖子的分都给你了,快来看看!!
- 如何显示读出的二进制文件
- 虚心请教高手们一个问题!谢谢你的帮助!!!
- 请问:如何正确地在DLL中的一个导出的类的声明里加CSocket对象
- dconcnfg配置,是应该在server所在的pc上,还是client所在的pc上??
virtual BOOL Open(
LPCTSTR lpszDSN,
BOOL bExclusive = FALSE,
BOOL bReadOnly = FALSE,
LPCTSTR lpszConnect = _T("ODBC;"),
BOOL bUseCursorLib = TRUE
);virtual BOOL OpenEx(
LPCTSTR lpszConnectString,
DWORD dwOptions = 0
); dwOptions
A bitmask which specifies a combination of the following values. The default value is 0, meaning that the database will be opened as shared with write access, the ODBC Cursor Library DLL will not be loaded, and the ODBC connection dialog box will display only if there is not enough information to make the connection.
CDatabase::openExclusive Not supported in this version of the class library. A data source is always opened as shared (not exclusive). Currently, an assertion fails if you specify this option.
CDatabase::openReadOnly Open the data source as read-only.
CDatabase::useCursorLib Load the ODBC Cursor Library DLL. The cursor library masks some functionality of the underlying ODBC driver, effectively preventing the use of dynasets (if the driver supports them). The only cursors supported if the cursor library is loaded are static snapshots and forward-only cursors. If you plan to create a recordset object directly from CRecordset without deriving from it, you should not load the cursor library.
CDatabase::noOdbcDialog Do not display the ODBC connection dialog box, regardless of whether enough connection information is supplied.
CDatabase::forceOdbcDialog Always display the ODBC connection dialog box. 可以看到Open函数的后几个参数在OpenEx里面整合到第二个参数了。Res
Your database object must be initialized before you can use it to construct a recordset object.Note Calling the OpenEx member function is the preferred way to connect to a data source and initialize your database object.微软推荐首选OpenEx 函数