MDBSecure 2008  

QueryDefs in .NET 

Home


MS Access Security tool         
Customer
I love MDBSecure--it was a great purchase for me.  However, once the Database is locked down, I have troubles doing advanced stuff with it.
 
I would like to be able to modify the QueryDefs in the database after it has been "MDBSecured."  For example, when I update the frontend program (written in C#.NET) and I need the backend database to be updated.
 
So let's say when my frontend program starts up, I want to detect whether or not a QueryDef is in the MDB file, and if it does not exist, create it.  As near as I can tell, QueryDefs can only be manipulated using ADOX and DAO COM libraries when using VS.NET.  Is this correct?
 
Since I'm using an OleDBConnection to the database, is it possible to build an ADOX connection string which uses my passwords, etc., that MDBSecure provides?
 
I'm trying to make a function that will create a QueryDef for me.... here's the pseudo code.
 

  public bool CreateQuery( string qryName, string qrySQL ) {
   bool retVal = true;
 
   ADOX.Catalog cat;
 
   try {
    cat = new ADOX.CatalogClass();
    cat.ActiveConnection = this.Connection;  // The class's OleDbConnection object
    cat.Procedures.Append( qryName, qrySQL );
   } catch (Exception ex) {
    Console.WriteLine( ex.Message );
    retVal = false;
   }
   return retVal;
  }

Support
To be honest MDBSecure is a spin off program, I wrote the basic functionality for another program.  I create a secure database and add tables.
 
I use ADOX to create tables.
 
Here's the sort of thing I do  
Code:

Dim tblADOXTopics As ADOX.Table = New ADOX.Table()
Dim tblADOTopicCodeIdx As New ADOX.Index()
 
NewDB.ActiveConnection = lcnn1
 
With tblADOXTopics
      .Name = "Topics"
      .Columns.Append("TopicCode", DataTypeEnum.adVarWChar, 13)
      tblADOTopicCodeIdx.Name = "TopicCode"
      tblADOTopicCodeIdx.Columns.Append("TopicCode")
      tblADOTopicCodeIdx.Unique = True
      tblADOXTopics.Indexes.Append(tblADOTopicCodeIdx)
      .Columns.Append("Level", DataTypeEnum.adInteger)
End With
 
NewDB.Tables.Append(tblADOXTopics)

 
However, I would use standard SQL for creating database objects.  That way you can easily use them if you upsize to a SQL Server database.
 
e.g.
Code:

Create Table CustomReports (CRID COUNTER, CustRepName char(50), ReportSQL Memo, Type Char(20), SysDB char(10), SequenceNum Long, Locked YesNo, InUse YesNo)
 
ALTER TABLE CustAccounts ADD COLUMN EMail text(50);

 
I used ADO not ADO.Net so I'm not sure about the connection string.  However, I would imagine you'd be able to use a Jet connection string??


For general information please see our product page


File size 2.5mb



Related Links

Read all open objects [WiredBox.Net - Office Newsgroups]
How would I adapt it to read queries? Additionally, 'AllQueries' is not an option. Will QueryDefs work? .... Newsgroups Reader - provided by WiredBox.Net.

DAO Querydef Object in ADO? [Archive] - dBforums
[Archive] DAO Querydef Object in ADO? comp.lang.basic.visual.database. ... NET, has about as much in common with ADO as VB.NET has with Visual Basic! ...

Interop DAO reference for Network Programming in .NET with C# ...
NET with C# & Visual Basic .NET (VB.NET) ... DAO reference for C# and VB.NET ... QueryDefs QueryDefs *; Int16 QueryTimeout *; Int32 RecordsAffected *; DAO. ...


MDBSecure  MS Access Security  MS Access Protection Software  MS Access Database Protection  Encrypt MS Access Database  MDB Security  Microsoft Access 2000 Security  Microsoft Access Database Security  Microsoft Access MDW  Microsoft Access Security FAQ  Microsoft Access Workgroup Security  Securing Microsoft Access  Don't have permissions...  QueryDefs in .NET  

About Us | Buy | Contact us | Distribution | Home | Links | Newsletters | Privacy | Site map | Support

   Mindwarp Consultancy Ltd © 2008. Registered in England No. 3893432
freeware free download
 
28/08/2008