PermaLink Hide Database Design01/16/2006
None

I found an interesting function recently while trying to find a way to easily hide the design of a database: NSFHideDesign. For 3rd party developers like a lot of you out there (Teamstudio included), hiding the design of a database is pretty important. Not just for protecting your work from people who would like to steal from it, but sometimes protecting them from themselves. Support calls due to someone mucking around in design they no nothing about can generate support issues that are sometimes tricky to identify. However, the process can be very cumbersome, especially if you are trying to hide the design of a template......


Turns out there is an undocumented export in nnotes.dll that will hide the design of a database. This function, 'NSFHideDesign' takes 4 parameters. The first 2 are handles to databases, the second 2 are Long's.  By passing the same handle for the first 2 parameters I was able to hide the design of my test template. I'm pretty sure that one parameter is the source template, and the other is the target database, but I'm not really sure. If anyone finds out more, please let me know!


PLEASE NOTE
: I have only explored this function enough to satisfy my project requirements using Notes 6.5.3. For me, the following code was enough, but it may not be for you. Also, as with all undocumented functions, everything here is subject to change at anytime without notice. IBM is under no obligation to support this function or it's current behavior. Don't be surprised if one day it suddenly stops working or does something completely unexpected.


Declare Function
NSFHideDesign Lib "nnotes.dll" (  Byval hdb1 As Long,  Byval hdb2 As Long,  Byval Unk1 As Long, Byval Unk2 As Long ) As Integer
Declare Function
NSFDbOpen Lib "nnotes.dll" (Byval pszPath As Lmbcs String, phdb As Long ) As Integer
Declare Function
NSFDbClose Lib "nnotes.dll" ( Byval hdb As Long ) As Integer

Sub
Click(Source As Button)
     
'open the database
     
Dim hdb As Long
      Dim
status As Integer
     
     
status = NSFDbOpen( "testdatabase.nsf", hdb )
      If
0 <> status Then
              Print
"Error"
             
Exit Sub
      End If
     
     
status = NSFHideDesign( hdb, hdb, 0, 0 )
      If
0 <> status Then
              Print
"Error"
     
End If
     
     
NSFDbClose hdb
End Sub

This page has been accessed 3028 times. .
Comments :v

1. Bevan Killian01/16/2006 10:31:52 AM


Can this process be reversered? Unhide the design?

thanks




2. Craig01/16/2006 11:50:08 AM
Homepage: http://blogs.teamstudio.com


Depends on what you expect to get back, I suppose. Hiding the design causes all the LotusScript source code to be removed and the formula's to be encrypted (among other things). This cannot be reversed. However, you can 'unset' the bit that prevents a database from being opened in Designer. This is a simple matter of clearing the REPLFLG_HIDDEN_DESIGN flag from the replication settings using the Notes C-API.




3. Volker01/18/2006 09:26:08 AM


To unhide the design you can use the menu item:
File -> Database -> Replace Design.

Remove the checkmark at "Hide formulas and LotusScript" and choose your unhidden Template.




4. Vipapuk S11/14/2007 02:36:25 AM


Usually I used "Hide formulas and LotusScript" but i still work if you are database manager. What is the best way if you are database designer?




5. Vipapuk S11/14/2007 02:36:25 AM


Usually I used "Hide formulas and LotusScript" but i still work if you are database manager. What is the best way if you are database designer?




6. Pascal Piot07/17/2008 06:35:06 PM
Homepage: http://www.geniusinside.com


Many thanks for this undocumented function.
I integrated it in the famous LibDesign library provided by Damian Katz.




7. sandeep12/03/2008 01:42:42 AM
Homepage: http://None :(


I am Sandeep. I have database on which I have to work out the CI-162 compliance, but the client had a provided me the template with design hidden.Could you please help in this regarding in making it unhide.I have used Archiving the db technique but even then the formulas and LS source codes are hidden.
Help me out.




8. sandeep12/03/2008 01:43:07 AM
Homepage: http://None :(


I am Sandeep. I have database on which I have to work out the CI-162 compliance, but the client had a provided me the template with design hidden.Could you please help in this regarding in making it unhide.I have used Archiving the db technique but even then the formulas and LS source codes are hidden.<br>Help me out.




9. Prakash Tandukar07/01/2009 09:16:11 AM
Homepage: http://blah.blah


I am also on the same island as Sandeep. I have a database from my client. Its design is hidden. So its formulae are also hidden. My aim is to extract the value of the formula which is hidden. For normal formula ie unhidden, I could decompile it using Notes C API to get its actual value. But for hidden formula, I could not decompile it. It returns 1315 status code which means NotesApi.ERR_HIDDEN_FORMULA.

But my question is how Notes Client is able to deal with this hidden formula? Can we now how Notes Client process hidden formula to extract its value?

Next, suppose I have got the original template with "design on" of that database. When I replace design for that database by original template with not checking "Hide formulas and Louts scripts", could I unhide the design of that database?

Please help.




Contact Me
Free tools!
The BlogRoll
Lotus Domino ND6 RSS News Feed netcraft Lotus Geek Chris. A. Brandlehner CoComment Integrated
Monthly Archive
Photo Albums