I'm using REALbasic 2007r1 for my test. Per your recommendation, I
changed the lines of code to use the EncryptionKey instead of the
password property, and viola, it worked the way you described.
Thank you for the help.
- Ryan Dary
Paul Hosking wrote:
> Not sure what version you are using but in Release Notes for RB2006 r4
> onwards to encrypt a database at point of creation the EncryptionKey must be
> set, so your examples should now be (taken from the latest language
> reference):
>
> //Creation
> dim db as new REALSQLDatabase
> db.DatabaseFile = GetFolderItem("db.rsd")
> db.EncryptionKey = "howdy doody"
> if not db.CreateDatabaseFile then
> <handle error>
> end if
>
> //And something like this to open that same database file:
> dim db as new REALSQLDatabase
> db.DatabaseFile = GetFolderItem("db.rsd")
> db.EncryptionKey = "howdy doody"
> if not db.Connect then
> <handle error>
> end if
>
> If you try and connect to an encrypted database and the EncryptionKey is not
> provided or wrong you should always get a File is encrypted or not a
> database error (error no. 26). So this would allow you detect that a
> database is encrypted when attempting to connect.
>
> Hope this helps,
>
> Paul Hosking
>
>
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Ryan
> Dary
> Sent: viernes, 04 de mayo de 2007 1:19
> To: REALbasic NUG
> Subject: Detecting encrypted databases
>
>
> Is there a way to know if a REALSQLDatabase has been encrypted or not?
> I used the two examples in the Language Reference:
>
> Dim db as New REALSQLDatabase
> db.DatabaseFile = GetFolderItem("db.rsd")
> db.Password = "howdy doody"
> If Not db.CreateDatabaseFile then
> //handle error here
> End if
>
>
> Dim db as New REALSQLDatabase
> db.DatabaseFile = GetFolderItem("db.rsd")
> db.Password = "howdy doody"
> if Not db.Connect then
> //handle error here
> End if
>
>
> Then, I commented out the line:
>
> db.Password = "howdy doody"
>
> In the second example, expecting the db.Connect to fail, and it doesn't.
> The database gets opened and there is no error.
>
> So, my question is, why? If the database in the first block was created
> with a password, and that password isn't presented when the db is
> connected to later, how is that helpful? I must be misunderstanding the
> use here..
>
> Any pointers?
>
> Thanks,
>
> Ryan Dary
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>
>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>