Collection Contents 上一页 下一页 PDF

UltraLite for MobileVB 用户指南

了解 UltraLite for MobileVB 开发

加密和模糊处理


您在使用 UltraLite for MobileVB 时,可以给 UltraLite 数据库加密或进行模糊处理。

加密 

要创建加密数据库,请设置 ULConnectionParms.EncryptionKey 属性。在您调用 CreateDatabaseWithParms 并传入 ConnectionParms 对象时,会创建数据库并使用指定的密钥将其加密。

有关 EncryptionKey 属性的详细信息,请参见 Encryption Key 连接参数 ChangeEncryptionKey 方法

示例 

您可以通过在 Connection 对象上指定新加密密钥来更改加密密钥。在本示例中,apricot 是加密密钥。

Connection.ChangeEncryptionKey("apricot")

对数据库进行了加密后,与数据库的连接必须指定正确的加密密钥。否则,连接将失败。

模糊处理 

若要对数据库进行模糊处理,请指定 obfuscate=1 作为一个创建参数。

有关数据库加密的详细信息,请参见加密 UltraLite 数据库

示例 

下面的代码会对新数据库进行模糊处理。

open_parms = "ce_file=\tutorial.udb;ce_schema=\tutorial.usm;obfuscate=1"
Set Connection = DatabaseManager.CreateDatabase( open_parms )

Collection Contents 上一页 下一页 PDF