我忘了在运行时打开ADO连接设置窗口的函数,谁能告诉我? (50分)

  • 主题发起人 主题发起人 qdgyh
  • 开始时间 开始时间
Q

qdgyh

Unregistered / Unconfirmed
GUEST, unregistred user!
我忘了在运行时打开ADO连接设置窗口的函数,谁能告诉我?
我说的是在运行时,有一个函数可以打开在设计时设置连接connecstring的窗口,
我忘了这个函数名了。
 
ADOconnectiont1.connected:=true;
 
S := PromptDataSource(FMainForm.Handle, ADOCombineConnectionString);
 
给个例子:
var CntStr:WideString;
begin
CntStr:=promptDataSource(0,'AdoCnt');
//Adocnt是随便给出的字符串,如连接正确,则CntStr不会等于该字符串
if CntStr<>'AdoCnt' then
begin
StatBar.SimpleText :=' 状态:已连接';
Memo2.Lines.Add('已成功连接到数据库');
AdoCnt.Connected :=false; //这里的AdoCnt是TAdoConnection控件。
AdoCnt.ConnectionString :=CntStr;
end;
end;
 
刚做完一个,正好在这用上了^_^
adoconnection1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+ExtractFilePath('scrproject.exe')+'Dbase.mdb;Persist Security Info=False';
 
后退
顶部