New topic: 

SQLDatabase Encryption - Does It Work?

<http://forums.realsoftware.com/viewtopic.php?t=34358>

         Page 1 of 1
   [ 3 posts ]                 Previous topic | Next topic          Author  
Message        paul3252          Post subject: SQLDatabase Encryption - Does It 
Work?Posted: Tue Jun 22, 2010 1:53 pm                         
Joined: Mon Jan 11, 2010 11:56 am
Posts: 42
Location: United Kingdom                I have seen some other posts, dating 
back a few years on this. I am using 2010R2 so I thought I should start a new 
thread;

Code:  db=New REALSQLdatabase
  db.Databasefile=GetFolderItem("d:\database.rsd")
  db.EncryptionKey="mypassword"
  db.decrypt()
  
  if not db.connect then
  msgbox(db.ErrorMessage)
  else
  //createdb
  end if

The above code does not seem to work for me. I have an encrypted database with 
the said password. The error message generated is;

"Operation cannot be completed because the database is closed"

If I remove the encryption on the database and the associated lines all woirks 
fine. Any ideas where I am going wrong?      
_________________
Paul
Realstudio 2010r2
Windows XP, Windows 7
  
                             Top                 timhare          Post subject: 
Re: SQLDatabase Encryption - Does It Work?Posted: Tue Jun 22, 2010 2:33 pm      
                   
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 7927
Location: Portland, OR  USA                You must open the database before 
you can decrypt it.  Also, Decrypt is not necessary to access an encrypted 
database - its function is to remove the encryption all together.   
                             Top                paul3252          Post subject: 
Re: SQLDatabase Encryption - Does It Work?Posted: Tue Jun 22, 2010 3:16 pm      
                   
Joined: Mon Jan 11, 2010 11:56 am
Posts: 42
Location: United Kingdom                Thanks for the pointer Tim, code 
changed to that below which works.

Code:dim a as boolean
db=New REALSQLdatabase
db.Databasefile=GetFolderItem("d:\database.rsd")
a=db.connect()  
db.EncryptionKey="mypassword"
  if a=false then
  msgbox(db.ErrorMessage)
  else
  //createdb
  end if      
_________________
Paul
Realstudio 2010r2
Windows XP, Windows 7
  
                             Top            Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 3 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to