你就看这个吧!
http://www.csdn.net/develop/Read_Article.asp?Id=13227
http://www.csdn.net/develop/Read_Article.asp?Id=13227
解决方案 »
- 原创 新作DELPHI 图片图像处理 PS置换滤镜效果,亮度/对比度,纹理贴图 ,无汇编全部GDI·· 大家鉴定下效果
- 超难问题:请问用程序如何实现win98登陆Nt/2000系统的计算机。
- 如何使用ADO打开带有密码的ACCESS数据库
- Delphi中调Excel时,如何在Excel表中插入一行?
- 请问如何给TNotifyEvent赋值
- 为了发展,减少压榨,我想辞职,怎样和老板说呢?愁啊
- 请问IDE在哪里?
- 我马上要去项目实施了,给点项目实施时的忠告好吗?
- dbnavigator使不得?
- 我看见已经有人解决了WEBbrowser中不能COPY地问题,但是我却无法用他地方法测试成功,请大家给我答案!!!!
- 散分,我就不信重赏之下没有勇夫。
- 再问:关于keydown与keypress?
var
registerTemp : TRegistry;
bData : array[ 0..0 ] of byte;
begin
registerTemp := TRegistry.Create;
//建立一个Registry实例
with registerTemp do
begin
RootKey:=HKEY_LOCAL_MACHINE;
//设置根键值为HKEY_LOCAL_MACHINE
//找到Software\ODBC\ODBC.INI\ODBC Data Sources
if OpenKey('Software\ODBC\ODBC.INI
\ODBC Data Sources',True) then
begin //注册一个DSN名称
WriteString( 'MyAccess', 'Microsoft
Access Driver (*.mdb)' );
end
else
begin//创建键值失败
memo1.lines.add('增加ODBC数据源失败');
exit;
end;
CloseKey;
//找到或创建Software\ODBC\ODBC.INI
\MyAccess,写入DSN配置信息
if OpenKey('Software\ODBC\ODBC.INI
\MyAccess',True) then
begin
WriteString( 'DBQ', 'C:\inetpub\wwwroot
\test.mdb' );//数据库目录,连接您的数据库
WriteString( 'Description',
'我的新数据源' );//数据源描述
WriteString( 'Driver', 'C:\PWIN98\SYSTEM\
odbcjt32.dll' );//驱动程序DLL文件
WriteInteger( 'DriverId', 25 );
//驱动程序标识
WriteString( 'FIL', 'Ms Access;' );
//Filter依据
WriteInteger( 'SafeTransaction', 0 );
//支持的事务操作数目
WriteString( 'UID', '' );//用户名称
bData[0] := 0;
WriteBinaryData( 'Exclusive', bData, 1 );
//非独占方式
WriteBinaryData( 'ReadOnly', bData, 1 );
//非只读方式
end
else//创建键值失败
begin
memo1.lines.add('增加ODBC数据源失败');
exit;
end;
CloseKey;
//找到或创建Software\ODBC\ODBC.INI
\MyAccess\Engines\Jet
//写入DSN数据库引擎配置信息
if OpenKey('Software\ODBC\ODBC.INI
\MyAccess\Engines\Jet',True) then
begin
WriteString( 'ImplicitCommitSync', 'Yes' );
WriteInteger( 'MaxBufferSize', 512 );//缓冲区大小
WriteInteger( 'PageTimeout', 10 );//页超时
WriteInteger( 'Threads', 3 );//支持的线程数目
WriteString( 'UserCommitSync', 'Yes' );
end
else//创建键值失败
begin
memo1.lines.add('增加ODBC数据源失败');
exit;
end;
CloseKey;
memo1.lines.add('增加新ODBC数据源成功');
Free;
end;
end;
odbcjt32.dll' );//驱动程序DLL文件
WriteInteger( 'DriverId', 25 );
//驱动程序标识注意到,里面有这样的语句,,这样写出来的程序不是不能通用了吗??
如果程序转到别人的机子上不是不能正常运行了吗?(系统文件夹目录不同)
NOt System Dsn!!
var
nBufferLength : DWORD;
lpBuffer : PChar;
begin
nBufferLength := MAX_PATH + 1; result:='';
GetMem( lpBuffer, nBufferLength );
try
if Windows.GetWindowsDirectoryA(lpBuffer, nBufferLength ) > 0 then
Result := lpBuffer;
finally
FreeMem( lpBuffer );
end;
end;
WriteString( 'Driver', myGetCurrentDirectory+'\SYSTEM\
odbcjt32.dll' );//驱动程序DLL文件
WriteInteger( 'DriverId', 25 );
//驱动程序标识