谁有自动创建ODBC(foxpro)的源代码?谢谢了! 你可以通过查找注册表,把所有与foxpro的odbc相关的键值取出来,键值不多,只有几个,你可以在程序中通过操作注册表的键值来动态增加数据源 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 constODBC_ADD_DSN = 1; // ' Add data sourceODBC_CONFIG_DSN = 2; // ' Configure (edit) data sourceODBC_REMOVE_DSN = 3 ;// ' Remove data source首先声明一个API函数:Function SQLConfigDataSource(hwndParent,fRequest:Longint;lpszDriver:string;lpszAttributes:string):Longint; stdcall;external 'ODBCCP32.DLL';添加一个dsn:function AddfoxproODBC(SourceName,DatabaseName,Desc,password:string):boolean;var intRet:longint; strDriver:string; strAttributes: string;begin strDriver:= 'Microsoft visul foxpro driver'strAttributes:= ('UID=admin'#0'DESCRIPTION='+Desc+#0'UserCommitSync=Yes'#0'Threads=3'#0'SafeTransactions=0'#0'PageTimeout=5'#0'MaxScanRows=8'#0'DSN='+SourceName+#0'MaxBufferSize=512'#0'ImplicitCommitSync=Yes'#0'FIL=MS Access'#0'DriverId=25'#0'DBQ='+DatabaseName+#0'PWD='+password+#0);//上面的默认参数你可以自己修改 intRet:= SQLConfigDataSource(0, ODBC_ADD_DSN, strDriver, strAttributes); result:=(intRet<>0);end;其中databasename为foxpro数据库所在路径.以上是我根据access的改写的,如有不对,请高手指教 你先创寻一个ODBC然后打开注册表看不就知了么 OpenThread这个函数.怎么在delphi中不能用? delphi新手求助..一个简单的问题 Delphi中自定义浏览器,如何判断 packed record对象为空 类弄转换 关于网吧杀木马的问题!![100分] Kingron(单身走我路……) 和 firetoucher(风焱) ( ) 在吗? 求一段代码,给分! delphi求算法 关于 软件产品化! 用ADOTable连接access出现"from子句语法错误",怎么回事? 大侠们好!小弟请问如何实现WINDOWS的F3查找功能?? 类型库的问题——在线等待
ODBC_ADD_DSN = 1; // ' Add data source
ODBC_CONFIG_DSN = 2; // ' Configure (edit) data source
ODBC_REMOVE_DSN = 3 ;// ' Remove data source
首先声明一个API函数:
Function SQLConfigDataSource(hwndParent,fRequest:Longint;lpszDriver:string;lpszAttributes:string):Longint; stdcall;external 'ODBCCP32.DLL';
添加一个dsn:
function AddfoxproODBC(SourceName,DatabaseName,Desc,password:string):boolean;
var intRet:longint;
strDriver:string;
strAttributes: string;
begin
strDriver:= 'Microsoft visul foxpro driver'strAttributes:= ('UID=admin'#0'DESCRIPTION='+Desc+#0'UserCommitSync=Yes'#0'Threads=3'#0'SafeTransactions=0'#0'PageTimeout=5'#0'MaxScanRows=8'#0'DSN='+SourceName+#0'MaxBufferSize=512'#0'ImplicitCommitSync=Yes'#0'FIL=MS Access'#0'DriverId=25'#0'DBQ='+DatabaseName+#0'PWD='+password+#0);
//上面的默认参数你可以自己修改
intRet:= SQLConfigDataSource(0, ODBC_ADD_DSN, strDriver, strAttributes);
result:=(intRet<>0);
end;其中databasename为foxpro数据库所在路径.以上是我根据access的改写的,如有不对,请高手指教
然后打开注册表看不就知了么