请问Delphi中的数据向导对话怎样实现?
我想编一个Delphi程序,在程序运行时出现一个数据连接向导(就像Delphi中的ADO数据库连接向导那样),请问应该怎么做? 问题点数:0、回复次数:3Top
1 楼jiangsheng(蒋晟.Net[MVP])回复于 2002-07-08 14:29:03 得分 0
#define _ADO_VER 0x0207
#if _ADO_VER >= 0x0201
// NOTE: UNCOMMENT FOLLOWING LINE IF USING MDAC 2.1 (ADO 2.1) and comment line with Msdasc.dll.
#import "C:\Program Files\Common Files\System\OLE DB\OLEDB32.dll" rename_namespace("dl20")
#else
// NOTE: UNCOMMENT FOLLOWING LINE IF USING MDAC 2.0 (ADO 2.0) and comment above line.
#import "G:\Program Files\Common Files\System\OLE DB\Msdasc.dll" rename_namespace("dl20")
#endif
//Reason: Datalink connection string builder, was moved to oledb32.dll in ADO2.1
//where as in ADO2.0 it was located in Msdasc.dll (ADO2.0)
#import "G:\Program Files\Common Files\SYSTEM\ADO\MSADO15.DLL" rename_namespace("ado20")
using namespace ado20;
void CAdoDataGridView::OnBuildconnstr()
{
using namespace dl20; // DataLinks #import
using namespace ado20; // ADO #import
HRESULT hr;
IDataSourceLocatorPtr dlPrompt = NULL;
_ConnectionPtr conn = NULL;
::CoInitialize( NULL );
//Launch DataLink connection dialog
hr = dlPrompt.CreateInstance(__uuidof(DataLinks));
conn = dlPrompt->PromptNew();
if ( conn!=NULL )
{
m_strConnect.Format( "%s", (char*) conn->ConnectionString );
UpdateData( FALSE );
}
}Top
2 楼chenybin(小马)回复于 2002-07-08 18:25:42 得分 0
UP好了Top
相关问题
- 用向导生成的对话框应用程序,能支持数据库吗,请教
- 简单问题:在delphi中,用Ttable连接oracle 数据库,怎样屏蔽掉连接数据库对话框?
- 对话框数据验证
- 如何在delphi中显示ado中选择数据源的链接属性对话框(data link properties)
- 一个极简单的问题,在向导生成的数据库程序中(用odbc连接),如何防止程序一打开就显示数据对话框?
- 利用向导导入数据
- 小妹?^_^?捉虫:我用delphi链接的数据库,为什么我每次运行时总要出现链接数据库的对话框?
- 用delphi连access数据表以后,为什么第一打开数据表是总有用户名和密码对话框?
- 帮帮忙!pb中如何做向导型的对话框!
- 一个关于建立向导对话框的问题!



