UniDAC使用说明(简单版)1.doc_第1页
UniDAC使用说明(简单版)1.doc_第2页
UniDAC使用说明(简单版)1.doc_第3页
UniDAC使用说明(简单版)1.doc_第4页
UniDAC使用说明(简单版)1.doc_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

UniDAC使用说明整理:兵临成下 QQ:383530895UniDAC官方网址:/一、连接数据库Connecting to Database1、 通用连接属性l Provider 第一个就应该设置的属性,指定要连接的数据库类型,根据指定的数据库连接类型不同其它的设置也会发生相应的变化;l Username and Password 登录数据的有效用户名和密码;l Server 通常将此设成要连接数据库所在的计算机名或IP地址,如果将此属性设置为空,对于MySQL, InterBase连接数据库方式, UniDAC 将试图连接本地(Localhost)。Oracle:客户端模式下,指定的Server名称一定要出现在tnsnames.ora中,且有效,设置效果如下: with UniConnection1 do begin ProviderName := Oracle; Server := ORCL; Username := username; Password := password; end;直连模式(Direct mode)下:在此模式下,运行软件的计算机可以不安装Oracle客户端而连接Oracle数据库,但要做以下设置:1) 设置直连模式2) 设置Server指定Server格式:Host:Port:SID.注:客户端模式和直连模式的设置不能混淆,否则无法执行。两种格式严格区分。效果如下: with UniConnection1 do begin ProviderName := Oracle; Server := 13:1521:ORCL; Username := Username ; Password := Password 3; end;SQL Server:指定要连接的数据库所在的网络IP,且有效,如果采用的不是默认端口(1433),Server应该这样设置:HostName,PortNumber.l Database 这个属性只对SQL Server, MySQL, PostgreSQL, InterBase, and SQLite 连接方式有效, l Port 指定TCP/IP协议访问的有效端口MySQL 默认端口 3306PostgreSQL -默认端口5432二、UniDAC(版本:2.7)连接数据库必要文件或局限需求1、Oracle连接Oracle在采用直连模式将受到以下限制:特别要注意的是(包括:应用TUniLoader):1)、应用直连模式,本地执行程序的客户机必须要安装TCP/IP协议2)、注意防火墙3)、数据库的triggers、check constraints、clustered tables、loading of remote objects、user-defined types将得不到支持4)、available, like OBJECT, ARRAY, REF, XML, BINARY_DOUBLE, BINARY_FLOAT这些类型将变为不可用5)、TUniLoader的应用版本应高于Oracle client 8.17以下是英文原文:l triggers are not supported l check constraints are not supported l referential integrity constraints are not supported l clustered tables are not supported l loading of remote objects is not supported l user-defined types are not supported l LOBs must be specified after all scalar columns l LONGs must be specified last l You cannot use TUniLoader in a threaded OCI environment with Oracle client 8.17 or lower. l Connect using the TCP/IP network protocol only. l Some types are not available, like OBJECT, ARRAY, REF, XML, BINARY_DOUBLE, BINARY_FLOAT. l Certain problems may occur when using firewalls. l NLS conversion on the client side is not supported. l Transparent Application Failover is not supported. l Statement caching is not available. l OS authentication and changing expired passwords features are not available. l The DES authentication is used. l Oracle Advanced Security is not supported. l We do not guarantee stability of multithreaded applications. It is highly recommended to use the separate TUniConnection component for each thread when using UniDAC from different threads. 2、 SQL Server连接1) 提供连接支持服务端: SQL Server 2005 (including Compact and Express editions), SQL Server 2000, SQL Server 7, and MSDE. 客户端: SQL OLE DB and SQL Native Client. 2) 环境需求MDAC(Microsoft Data Access Components)版本不低于2.53、 My SQL连接My SQL提供的连接也包括直连和客户端连接方式,默认采用的是直连方式,如果要更改连接方式,在应用程序分发时要带上libmysqld.dll二、Delphi与各数据库数据类型比较Delphi数据类型与各数据库数据类型对比如下表,如有具体说明见表中脚注:Delphi TypeOracle TypesSQL Server TypesMySQL Types 1InterBase TypesPostgreSQL TypesSQLite TypesftSmallintNUMBER(p, 0)2 (p 1)SMALLINTSMALLINTSMALLINTTINYINTSMALLINTftWord-TINYINTTINYINT(M) UNSIGNED (M 1)SMALLINT UNSIGNEDYEAR-ftIntegerNUMBER(p, 0)2(4 p 10)INTMEDIUMINTMEDIUMINT UNSIGNEDINTINTEGERINTEGERINTEGERINTftLargeintNUMBER(p, 0)2 (9 p 19)BIGINTBIT INT UNSIGNEDBIGINTBIGINT UNSIGNEDBIGINTBIGINTBIGINTftFloatNUMBER(p, s)2 BINARY FLOAT(FLOAT)BINARY DOUBLEDECIMAL(p, s)3 FLOATREALDECIMAL(p, s)3 FLOATDOUBLENUMBER(p, s)3 FLOATDOUBLE PRECISIONDECIMAL3 REALDOUBLE PRECISIONDECIMAL(p, s)3FLOATDOUBLE PRECISIONftBCDNUMBER(p, s)2 (p 15) and (s 5)DECIMAL(p, s)3 (p 15) and (s 5)DECIMAL(p, s)3 (p 15) and (s 5)DECIMAL(p, s)3 (p 15) and (s 5)DECIMAL3DECIMAL3ftFMTBcdNUMBER(p, s)2 (14 p (4 s 39)DECIMAL(p, s) (14 p 39) and (4 s 39)DECIMAL(p, s)3 (14 p 39) and(4 s 39)DECIMAL(p, s)3 (14 p 19) and(4 s 19)DECIMAL3DECIMAL3ftCurrency-MONEYSMALLMONEY-MONEYMONEYftBoolean-BITTINYINT4 BOOL4 BOOLEAN4BOOLEANBOOLEANBOOLEANftStringVARCHAR2NVARCHAR2VARCHARCHARNCHARRAW5 INTERVAL DAY TO SECONDINTERVAL DAY TO MONTHROWIDUROWIDCHARVARCHARCHARVARCHARENUMSETBINARY6 VARBINARY6CHARVARCHARCHARVARCHARCHARVARCHARftWideStringSee note 7NCHARNVARCHARSee note 7See note 7See note 7See note 7ftMemoLONGAlso see note 8TEXTNTEXT9TINYTEXTTEXTMEDIUMTEXTLONGTEXTBLOB TEXTTEXTTEXTCLOBftWideMemoSee note10NTEXT11See note10See note10See note10See note10ftOraClobCLOBNCLOB-ftBlobLONG RAWIMAGETINYBLOBBLOBMEDIUMBLOBLONGBLOBSpatial Data TypesBLOB BINARYBYTEABLOBftOraBlobBLOB-LARGE OBJECT-ftBytes-BINARYTIMESTAMPBINARY-ftVarBytesRAWVARBINARYVARBINARYCHARVARCHAR(CHARSET = OCTETS)-BINARYVARBINARYftDate-DATEDATEDATEDATEftDateTimeDATEDATEDATETIMETIMESTAMPTIMESTAMPTIMESTAMPDATETIMEftTime-TIMETIMETIMETIMEftTimeStampTIMESTAMPTIMESTAMP WITH TIMEZONE-ftCursorREF CURSOR-REFCURSOR-ftGuid-UNIQUEIDENTIFIER-ftVariant-SQL_VARIANT-NOT SUPPORTEDBFILEOBJECTXMLCURSORXMLTABLE-1 如果FieldsAsString 选项被设置 True,则除BLOB和TEXT数据类型外,全部做为ftString来处理2 Oracle NUMBER数据类型与Delphi数据类型对应方式:if scale equals zero, provider checks values of the specific options to choose the correct Delphi type in the following order: 1.1 field precision is less or equal Precision Smallint (default is 4) - uses ftSmallint;1.2 field precision is less or equal Precision Integer (default is 9) - uses ftInteger;1.3 field precision is less or equal Precision LargeInt (default is 18) - uses ftLargeint;if scale is greater than zero, the appropriate Delphi type is chosen using the following sequence of rules:. 2.1 field precision is less or equal PrecisionFloat (default is 0) - uses ftFloat;2.2 EnableBCD is True and field precision, scale is less or equal PrecisionBCD (default is 14,4) - uses ftBCD;2.3 EnableFMTBCD is True and field precision, scale is less or equal PrecisionFMTBCD (default is 38,38) - uses ftFMTBCD;2.4 uses ftFloat.3 - The appropriate Delphi type is chosen using the following sequence of rules:EnableBCD is True and field precision, scale is less or equal 14,4 - uses ftBCD; EnableFMTBCD is True - uses ftFMTBCD; uses ftFloat. 4 - If the EnableBoolean option is True5 - If the RawAsString option is True6 - If the BinaryAsString is True7 - If the UseUnicode option is True, all server types mapped to ftString will be mapped to ftWideString.8 - If the LongStrings option is False, and the field length is greater than 255, all server types mapped to ftString will be mapped to ftMemo.9 - For all Delphi versions prior to BDS 2006.10 - If the UseUnicode option is True, in BDS 2006 and later versions all server types mapped to ftMemo will be mapped to ftWideMemo.11 - For BDS 2006 and higher IDE versions.三、UniDAC更新数据1、数据自动更新TUniTable、TUniQuery和TUniStoredProc是用来检索和编辑数据的UniDAC控件,四、主从关系表五、存储过程1、TUniConnection, TUniSQL, TUniQuery, TUniStoredProc均可以执行存储过程。TUniConnection:是一种最

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论