Solved

CryptoAPI in VBA 7

Posted on 2012-04-09
7
1,982 Views
Last Modified: 2012-04-12
I am trying to use CryptoAPI using VBA 7 in a Windows 7,  64 bit environment.  Will this ever work?  I am trying to use Cryptography for Visual Basics by Richard Bondi but this is not working.  I getting type mismatch on CryptImportKey function for the Pointer to the CSP handler.

What would be the best way to implement Encryption/Decryption in this environment?
0
Comment
Question by:kkhan7
  • 4
  • 2
7 Comments
 
LVL 21
ID: 37825081
Her is what i use:  Encryption
0
 
LVL 12

Accepted Solution

by:
danishani earned 500 total points
ID: 37826347
0
 

Author Comment

by:kkhan7
ID: 37832635
Daniel,  

Thanks for your reply.  However, I had tried the code from the jdk site and I am using the correct PtrSafe datatypes and I am still receiving errors.  The VB code will work in using VBA in a Windows 7, 64-bit environment?
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 21
ID: 37833950
Are you using he Access 2010 64-bit?  

I run Access 2003/2007/2010 32-bit versions on 64-bit windows OS's without having to use PtrSafe datatypes. AFAIK, you only need to use PtrSafe datatypes in VBA with Office 2010 64-bit apps.

The link I provided work fine on XP 64-bit/Vista 64-bit/Win 7 64-bit with Access 2003/2007/2010 32-bit.
0
 

Author Comment

by:kkhan7
ID: 37835108
Daniel,

Yes, I am using MS Access 64-bit, VBA 7 on Windows 7, 64-bit environment.  I get errors on CreateImportKey function when trying to import a private key.

Signed,
KKhan7
0
 

Author Comment

by:kkhan7
ID: 37839293
Daniel,

Thanks for your help.  I have switched to using Visual Studio 2010 to create a .NET class that I can call from VBA.

http://support.microsoft.com/kb/317535

Article ID: 317535 - Last Review: March 29, 2007 - Revision: 8.5

HOW TO: Call a Visual Basic .NET Class Library from Visual Basic for Applications in Microsoft Office


Signed,
KKhan7
0
 

Author Closing Comment

by:kkhan7
ID: 37839303
This solution had lots of information it just didn't work for my situation.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Explore the encryption capabilities built into Google Apps and how these features can help you meet privacy policy and regulatory compliance, but are not a full solution. Understand and compare the most popular email encryption services for Google A…
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now