在安裝RAD Studio DELPHI 2007後,C:\Documents and Settings\user\My Documents\RAD Studio\5.0\Demos\database\projects\dbx\driver\as400資料夾中有提供連接AS400的Driver。
Installation instructions for dbexpca400 (dbExpress driver)
##CONTINUE##-----------------------------------------------------------
0) set up your iSeries or AS/400 connection in iSeries Access, for this example the connection is called "MYAS400" (usually this is already configured)
1) copy dbexpca400.dll to a directory that is in your path, make sure only one version of dbexpca400.dll is on your system. The Windows\system or WINNT\system32 directory is a good place for the driver.
(optional) copy dbexpca400.obj and iseriesaccess.obj to $(BCB)\Lib for C++Builder 6 (optional) copy dbexpca400.dcu and iseriesaccess.dcu to $(Delphi)\Lib for Delphi 7 or 6
2) modify dbXDrivers.ini, depending on your Delphi version in
Delphi 2007: %Public%\Documents\RAD Studio\dbexpress Delphi 2005: %CommonProgramFiles%\Borland Shared\BDS\dbExpress Delphi 2006: %ProgramFiles%\BDS\4.0\dbexpress Delphi 6, Delphi 7, C++Builder 6: %CommonProgramFiles%\Borland Shared\DBExpress\
[Installed Drivers] CA400=1
[CA400] GetDriverFunc=getSQLDriverCA400 LibraryName=dbexpca400.dll VendorLib=cwbdb.dll Database=MYAS400 User_Name= Password= ServerCharSet= ErrorResourceFile= LocaleCode=0000 BlobSize=-1 RowsetSize=-1 RoleName= CA400 TransIsolation=DirtyRead CommitRetain=True AutoCommit=True Custom String=/trace=0 Connection Timeout=-1 Trim Char=False
[CA400 TransIsolation] DirtyRead=0 ReadCommited=1 RepeatableRead=2
3) drop a TSQLConnection on a form, double click the TSQLConnection then choose "+ Add Connection", select driver name "CA400" and give your connection a name, for example "MYCA400CONN". Check that Database is set to the connection you defined in iSeries Access (MYAS400)
4) set the "LoginPrompt" property of SQLConnection to false if you don't want to be prompted for a password (the connection security is maintained by iSeries Access)
5) drop a TSQLQuery on your form, set it's SQLConnection property to your SQLConnection. Set the SQL property to for example 'select * from "QIWS"."QCUSTCDT"' (QIWS.QCUSTCDT is a standard table on every iSeries system)
沒有留言:
張貼留言