如何列出本机支持的数据驱动列表? 如何列出本机支持的数据驱动列表? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 BDE 用SessionODBC 用注册表 1BDE, use DbTables Session.GetDriverNames(CmbAccAlias.Items);2ODBC, 刚好昨天写了一个 procedure ListODBCDSN(AList: TStrings; AFlag: Integer); AFlag 0:用户DSN, 1:系统DSN 2: 所有DSNvar Reg: TRegistry; UserList, SysList: TStringList;begin if AList = nil then Exit; AList.Clear; Reg := TRegistry.Create; try case AFlag of 0: begin Reg.RootKey := HKEY_CURRENT_USER; Reg.OpenKey('Software\ODBC\ODBC.INI', False); Reg.GetKeyNames(AList); Reg.CloseKey; end; 1: begin Reg.RootKey := HKEY_LOCAL_MACHINE; Reg.OpenKey('Software\ODBC\ODBC.INI', False); Reg.GetKeyNames(AList); Reg.CloseKey; end; 2: begin UserList := TStringList.Create; SysList := TStringList.Create; try ListODBCDSN(UserList, 0); ListODBCDSN(SysList, 1); UserList.AddStrings(SysList); UserList.Sort; AList.Assign(UserList); finally SysList.Free; UserList.Free; end; end; end; finally Reg.Free; end;end; CreateThread参数求助? delphi如果访问url 管理 session 放分... SQLQuery Insert 出错:'不正常的定义参数对象 提供了不一致或不完整的信息' 关闭已经打开的文件出错~在线等待解决办法~~ 在线等待,有关ActiveX Form怎样在IE中发布,控件里面访问了C:\test.ini文件中的内容? 基本问题! 请问操作系统日志的api函数应该怎么调用? 访问外地服务器问题(非局域网访问) 关于SYBASE TEXT乱码问题 不用控件连接ADO的CONNECTIONG和RS? 请问怎编写播放DVD碟的程序
ODBC 用注册表
use DbTables Session.GetDriverNames(CmbAccAlias.Items);2ODBC, 刚好昨天写了一个 procedure ListODBCDSN(AList: TStrings; AFlag: Integer); AFlag 0:用户DSN, 1:系统DSN 2: 所有DSN
var
Reg: TRegistry;
UserList, SysList: TStringList;
begin
if AList = nil then Exit;
AList.Clear;
Reg := TRegistry.Create;
try
case AFlag of
0: begin
Reg.RootKey := HKEY_CURRENT_USER;
Reg.OpenKey('Software\ODBC\ODBC.INI', False);
Reg.GetKeyNames(AList);
Reg.CloseKey;
end;
1: begin
Reg.RootKey := HKEY_LOCAL_MACHINE;
Reg.OpenKey('Software\ODBC\ODBC.INI', False);
Reg.GetKeyNames(AList);
Reg.CloseKey;
end;
2: begin
UserList := TStringList.Create;
SysList := TStringList.Create;
try
ListODBCDSN(UserList, 0);
ListODBCDSN(SysList, 1);
UserList.AddStrings(SysList);
UserList.Sort;
AList.Assign(UserList);
finally
SysList.Free;
UserList.Free;
end; end;
end;
finally
Reg.Free;
end;
end;