Results 1 to 38 of 38

Thread: RC6 - New encrypt option for Sqlite DB: SqlCipher

Threaded View

  1. #11
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: RC6 - New encrypt option for Sqlite DB: SqlCipher

    Quote Originally Posted by Schmidt View Post
    And I don't have the time currently, to dive into the intricacies of:
    - recompiling the .NET-wrapper for SQLite in a proper manner (using proper includes)...
    - so that these free crypto-extensions will work as they should, without breaking other things in the .NET-wrapper
    I was just about to suggest that there is nothing stopping him from just using your library in .Net until a suitable .Net alternative can be found but I decided to test this before I made this suggestion. It seems that the vbRichClient library cannot work in .Net. I don't pretend to be a COM expert but based on the errors reported by Visual Studio 2019, I'm guessing your library doesn't fully respect the COM specification. For whatever reason VB6 puts up with it and I've heard rumors it even works in TwinBASIC but as far as the .Net is concerned, it's type library is broken. It generated 32 errors, among them it even found an interface that is not derived from IUnknown:-
    Code:
    Warning		Processing COM reference "VB" from path "C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.OLB". Type library importer has encountered an interface not derived from IUnknown: '___MSJetSQLHelp'.
    As far as I know, this is a major COM violation since the COM specification/documentation makes it's clear that all interfaces must be derived from IUnknown. I then tested ADO(ActiveX Data Objects 6), another COM library that is roughly comparable in complexity to vbRichClient and that worked without a problem. It not only got imported correctly, it actually worked. I was able to query a database using plain old COM ADO in .Net:-
    Code:
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim c As New ADODB.Connection
            Dim sb As New SqlConnectionStringBuilder
    
            sb.InitialCatalog = "EmSqlDB"
            sb.DataSource = "VBBOX"
            c.Provider = "sqloledb"
    
            c.ConnectionString = sb.ToString & ";Integrated Security=SSPI"
            c.Open()
    
            Dim rs As ADODB.Recordset = c.Execute("Select * From TblProducts")
    
            Do Until rs.EOF
                Debug.WriteLine(rs.Fields.Item(2).Value.ToString)
                rs.MoveNext()
            Loop
    
        End Sub
    Unfortunately my knowledge of COM is far too limited to figure out how to make vbRichClient work in a .Net solution but it would have been a nice easy solution to the OP's problem if it did. This is one of the rare instances where your library actually covers something that isn't by the .Net ecosystem, as far as we know anyway.
    Last edited by Niya; Sep 17th, 2021 at 10:11 PM.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width