On Oct 04, 2006, at 8:21 PM, Kirt Cathey wrote:

Poking around looking for code snippets or direction on how to encrypt
a REALSQLDatabase. The documentation that comes with the program
download doesn't seem to cover this, while the announcement states
that this feature is supported.

Any pointers would be helpful. Already searched the user forums.

Some quick and dirty code

Create an encrypted db

  dim ft as filetype
  dim db as REALSQLDatabase

  ft = new FileType
  ft.MacCreator = "????"
  ft.MacType = "????"
  ft.Extensions = ""

  db = new REALSQLDatabase

  db.DatabaseFile = GetSaveFolderItem(ft,"new db")

  if db.CreateDatabaseFile() then

    db.Encrypt("123") // 123 is the encryption key

  end if

Connect to an encrypted db

  dim ft as filetype
  dim db as REALSQLDatabase

  ft = new FileType
  ft.MacCreator = "????"
  ft.MacType = "????"
  ft.Extensions = ""

  db = new REALSQLDatabase

  db.DatabaseFile = GetOpenFolderItem(ft)
  db.EncryptionKey = "123"

  if db.Connect() then

        // connection works when you have the right key

  end if
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to