﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Accessing files encrypted with Cryptor during design time</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sat, 19 Sep 2026 04:19:49 GMT</lastBuildDate><ttl>20</ttl><item><title>Accessing files encrypted with Cryptor during design time</title><link>http://forum.strataframe.net/FindPost9424.aspx</link><description>We use Cryptor to keep dbfs encrypted in disk.&amp;nbsp; With the&amp;nbsp;VFP code below we can&amp;nbsp;access those encrypted tables via VfpOleDb.&lt;P&gt;Fast forward to Strataframe.&amp;nbsp; I&amp;nbsp;need to access&amp;nbsp;those tables from Strataframe&amp;nbsp;both at runtime and&amp;nbsp;at design time.&amp;nbsp;&amp;nbsp;Runtime seems straightforward (though I haven't done it yet&amp;nbsp;:) ), but where would you place the equivalent code&amp;nbsp;in the development environment so that the BO mapper can access the encrypted dbf?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;CLOSE ALL&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;&lt;P&gt;* Instantiate Cryptor and tell it to watch disk access by oledb32.dll&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;poCryptor = &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;CreateObject&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt;("XitechCryptor.Cryptor")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;poCryptor.WatchDLL("oledb32.dll")&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;&lt;P&gt;* Register table plemp.dbf with Cryptor as encrypted&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt;MyCryptor('plemp.dbf')&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;&lt;P&gt;* Access plemp.dbf via vfpoledb&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;LOCAL &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;oConn &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;as &lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt;"adodb.connection"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;LOCAL &lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;oRS &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;as &lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;"adodb.recordset"&lt;/P&gt;&lt;P&gt;oConn = &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;CREATEOBJECT&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;('adodb.connection')&lt;/P&gt;&lt;P&gt;oRS = &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;CREATEOBJECT&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;('adodb.recordset')&lt;/P&gt;&lt;P&gt;cConnStrng = "Provider=vfpoledb;Data Source=" + "z:\VPay950\Contab\sosa"&lt;/P&gt;&lt;P&gt;oConn.&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;Open&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;(cConnStrng)&lt;/P&gt;&lt;P&gt;oRS = oConn.Execute("SELECT * FROM plemp")&lt;/P&gt;&lt;P&gt;?oRS.&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;Fields&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;("ccodemp").&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;Value&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;oRS.&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;Close&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt;()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;oConn.&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;Close&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;()&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;FUNCTION &lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt;MyCryptor&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;PARAMETER &lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt;tcFile&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;lcPassword = 'password'&lt;/P&gt;&lt;P&gt;lnAlgorithmNumber = xxx&lt;/P&gt;&lt;P&gt;poCryptor.Register(tcFile,lcPassword,lnAlgorithmNumber)&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Thu, 14 Jun 2007 09:18:40 GMT</pubDate><dc:creator>AlexSosa</dc:creator></item><item><title>RE: Accessing files encrypted with Cryptor during design time</title><link>http://forum.strataframe.net/FindPost9574.aspx</link><description>[quote]Exactly, thank you.&amp;nbsp; Some day I will know enough about .NET as I know of VFP, hopefully.[/quote]&lt;/P&gt;&lt;P&gt;You are already well on your way.&amp;nbsp; It is just like anything else, you just have to familiarize yourself with it and then you move forward faster and faster.&amp;nbsp; :)</description><pubDate>Thu, 14 Jun 2007 09:18:40 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Accessing files encrypted with Cryptor during design time</title><link>http://forum.strataframe.net/FindPost9564.aspx</link><description>Trent,&lt;P&gt;Exactly, thank you.&amp;nbsp; Some day I will know enough about .NET as I know of VFP, hopefully.&lt;P&gt;Alex</description><pubDate>Wed, 13 Jun 2007 23:31:29 GMT</pubDate><dc:creator>AlexSosa</dc:creator></item><item><title>RE: Accessing files encrypted with Cryptor during design time</title><link>http://forum.strataframe.net/FindPost9550.aspx</link><description>Well, if I were guessing, I would think that you are running some .NET code on a network drive.&amp;nbsp; By default .NET code cannot execute on a network drive because the security policies are not trusted.&amp;nbsp; You can get around this by changing your security settings through the .NET Framework Configuration console.&lt;P&gt;Start -&amp;gt; Control Panel -&amp;gt; Administrative Tools -&amp;gt; Microsoft.NET Framework 2.0 Configuration&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/648e2120-6fa6-4fd3-8572-af5b.png"&gt;&lt;/P&gt;&lt;P&gt;You will want to adjust the Zone Security for your computer.&amp;nbsp; Select the Local Intranet and provide Full Trust.&amp;nbsp; This is the first place I would look.</description><pubDate>Wed, 13 Jun 2007 17:42:23 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Accessing files encrypted with Cryptor during design time</title><link>http://forum.strataframe.net/FindPost9541.aspx</link><description>Hi Trent,&lt;P&gt;Good idea about using unencrypted files to map the schemas, and I may have to do that.&amp;nbsp; In the mean time, when testing the the run-time access I found a rights problem instantiating the Cryptor object.&amp;nbsp; This is not a Strataframe problem, of course, just a result of being new to .NET, but could you give me some guidance, please?&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;PRE class=Code&gt;At this point an error ocurrs at runtime: Security exception was unhandled.&lt;/PRE&gt;&lt;PRE class=Code&gt;&lt;PRE class=Code&gt;[codesnippet]Imports XitechCryptorModule Module1&lt;BR&gt;    Public oXitechCryptor As XitechCryptor.Cryptor&lt;BR&gt;    Sub Main()&lt;BR&gt;        ' Instantiate Cryptor and tell it to watch disk access by oledb32.dll&lt;BR&gt;        oXitechCryptor = New XitechCryptor.Cryptor()&lt;BR&gt;[/codesnippet]&lt;/PRE&gt;&lt;PRE class=Code&gt;&amp;nbsp;&lt;/PRE&gt;[codesnippet]System.Security.SecurityException was unhandled&lt;BR&gt;  Message="System.Security.Permissions.SecurityPermission"&lt;BR&gt;  Source="ConsoleApplication1"&lt;BR&gt;  StackTrace:       at ConsoleApplication1.Module1.Main()&lt;BR&gt;       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)&lt;BR&gt;       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)&lt;BR&gt;       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()&lt;BR&gt;       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)&lt;BR&gt;       at System.Threading.ExecutionContext.runTryCode(Object userData)&lt;BR&gt;       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)&lt;BR&gt;       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)&lt;BR&gt;       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)&lt;BR&gt;       at System.Threading.ThreadHelper.ThreadStart()&lt;BR&gt;[/codesnippet]&lt;/PRE&gt;&lt;PRE class=Code&gt;&amp;nbsp;&lt;/PRE&gt;</description><pubDate>Wed, 13 Jun 2007 09:16:28 GMT</pubDate><dc:creator>AlexSosa</dc:creator></item><item><title>RE: Accessing files encrypted with Cryptor during design time</title><link>http://forum.strataframe.net/FindPost9435.aspx</link><description>Yeah, I have been thinking about this and really there is no way at the moment within the designer to have pre and post initialization code.&amp;nbsp; I have no experience with this Cryptor product you are referring to....have you tried to pull a schema through the BO Mapper?&amp;nbsp; If so, does it just not recognize the file structures or do you get an error?&amp;nbsp; Last, is there anyway that you could just have some unencrypted files that you use to map your schemas since you already know you can work around this at run-time?</description><pubDate>Fri, 08 Jun 2007 10:53:55 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Accessing files encrypted with Cryptor during design time</title><link>http://forum.strataframe.net/FindPost9433.aspx</link><description>Hi Alex.&lt;/P&gt;&lt;P&gt;I think the BO Mapper will have no problem mapping your VFP table. Have you gone through the process to do it? (create your BO in your project, go to BOMapper, right-click your project and go to Properties, fill in the OLE DB Connection String, right-click you BO, choose Properties and select OLE DB from the radio button group and them Select Source button.) This should take you to your .DBC, letting you choose your .dbf&lt;/P&gt;&lt;P&gt;I'm not sure where your Encryptor should be instantiated, but I guess the guys here will have a good idea to give you.&lt;/P&gt;&lt;P&gt;Abraços.</description><pubDate>Fri, 08 Jun 2007 10:04:52 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>