Results 1 to 4 of 4
  1. #1
    hank is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2014
    Location
    Indonesia
    Posts
    2

    how to this code vb.net used code vba ms access

    how to this code vb.net used code vba ms access?

    Imports System.Security.Cryptography

    Imports System.Text

    Namespace BpjsIntegration
    Class Program

    Private Shared Sub Main()
    Dim data = "testtesttest"
    Dim secretKey = "secretkey"

    ' Initialize the keyed hash object using the secret key as the key
    Dim hashObject As New HMACSHA256(Encoding.UTF8.GetBytes(secretKey))

    ' Computes the signature by hashing the salt with the secret key as the key
    Dim signature = hashObject.ComputeHash(Encoding.UTF8.GetBytes(data ))

    ' Base 64 Encode


    Dim encodedSignature = Convert.ToBase64String(signature)

    ' URLEncode
    ' encodedSignature = System.Web.HttpUtility.UrlEncode(encodedSignature)

    Console.WriteLine("Voila! A signature: " & encodedSignature)

    Console.ReadKey()

    End Sub
    End Class
    End Namespace

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Hank,

    I have no idea what your question is.

    My best guess is you want to know how to use this vb.net code in vba, but that's a guess.
    If English is not your first language, then use Google translate to take the question you write in your language and translate to English and post.

    I have not used vb or net framework libraries with vba. I'd be interested in any responses or samples.

    Good luck.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,523
    You can't DIM var = "literal"
    you must use CONST var= "literal"

    the system.componant.conponant won't work in vba.
    you must use an API or system("componant")

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Here's a link (calling a net library from Access) I found that may be helpful.
    Here's another https://msdn.microsoft.com/en-us/lib...(v=vs.71).aspx

    I think we really need someone who has used net framework libraries and vb or c# procedures with MSAccess vba to show us/lead us through some examples.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 09-22-2016, 02:37 AM
  2. Replies: 5
    Last Post: 08-29-2016, 04:33 AM
  3. update VBA 2.0 code in forms into access 7.0 code
    By toughwg in forum Programming
    Replies: 1
    Last Post: 12-08-2015, 11:40 AM
  4. Word code in Access - How to modify my current code
    By Alexandre Cote in forum Programming
    Replies: 0
    Last Post: 11-15-2010, 08:26 AM
  5. Access 2003 code vs Access 2007 Code
    By ralphjramirez in forum Access
    Replies: 5
    Last Post: 11-23-2009, 12:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums