PC Review


Reply
Thread Tools Rate Thread

Access 2000 VBA with .net Framework 2.0 issue

 
 
gardenofsimple@gmail.com
Guest
Posts: n/a
 
      4th Feb 2009
Hi everyone!

I just wanted some opinions before I gave up on this solution
altogether and found another way. I know that there are many ways to
solve this problem, it's just that this one seemed simple and elegant
(until it didn't work!)

The givens are that a) I must use Access 2000 and b) I am stuck
with .net Framework 2.0. I cannot upgrade either of these products.
I'm sorry. I realize that upgrading both would most likely solve this
instantly.

So: working within these constraints, what I wanted to do was write a
very short VBA module to encrypt a few strings using the SHA512
algorithm.

I wanted to use the SHA512 class from the System.Security.Cryptography
namespace:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha512(VS.80).aspx

However, I can't get it to work.

1) I can add mscorlib.dll as a reference.
2) I can create an instance of SHA512 -- Dim x As New SHA512

The problem occurs when I try to use the ComputeHash method. The code
y = x.ComputeHash(z) causes VBA to return the runtime error "Invalid
procedure call or argument".

When I look at the SHA512 class in Object Browser, it contains no
members. This is really puzzling to me.

So my question is: why would the Object Browser show no members and
yet VBA is willing to let me create an instance of this class?

Is there something simple I'm missing here? Or is this never going to
work.

Thanks for your help.

C.
 
Reply With Quote
 
 
 
 
gardenofsimple@gmail.com
Guest
Posts: n/a
 
      4th Feb 2009
On Feb 3, 11:01*pm, Tom van Stiphout <tom7744.no.s...@cox.net> wrote:
> On Tue, 3 Feb 2009 17:15:38 -0800 (PST), gardenofsim...@gmail.com
> wrote:
>
> As you found out: it don't work that way. VBA cannot use .NET
> assemblies directly.
> In a similar situation we wrote a .NET assembly and gave it a COM
> wrapper. THEN you can reference that DLL from Access and call its
> public interface.
>
> -Tom.
> Microsoft Access MVP
>
> >Hi everyone!

>
> >I just wanted some opinions before I gave up on this solution
> >altogether and found another way. I know that there are many ways to
> >solve this problem, it's just that this one seemed simple and elegant
> >(until it didn't work!)

>
> >The givens are that a) I must use Access 2000 and b) I am stuck
> >with .net Framework 2.0. I cannot upgrade either of these products.
> >I'm sorry. I realize that upgrading both would most likely solve this
> >instantly.

>
> >So: working within these constraints, what I wanted to do was write a
> >very short VBA module to encrypt a few strings using the SHA512
> >algorithm.

>
> >I wanted to use the SHA512 class from the System.Security.Cryptography
> >namespace:
> >http://msdn.microsoft.com/en-us/libr...y.cryptography....

>
> >However, I can't get it to work.

>
> >1) I can add mscorlib.dll as a reference.
> >2) I can create an instance of SHA512 -- Dim x As New SHA512

>
> >The problem occurs when I try to use the ComputeHash method. The code
> >y = x.ComputeHash(z) causes VBA to return the runtime error "Invalid
> >procedure call or argument".

>
> >When I look at the SHA512 class in Object Browser, it contains no
> >members. This is really puzzling to me.

>
> >So my question is: why would the Object Browser show no members and
> >yet VBA is willing to let me create an instance of this class?

>
> >Is there something simple I'm missing here? Or is this never going to
> >work.

>
> >Thanks for your help.

>
> >C.


Tom thank you SO much for pointing me in the right direction. I
thought I was going to go mad from not being able to figure out why.

C.
 
Reply With Quote
 
David H
Guest
Posts: n/a
 
      4th Feb 2009
FYI - Sounds like for what you're doing moving to a later version of Access
is a moot point. Also, all of the various versions of Access are releases
with a freely downloadable & redistributable (sp?) version of Access. There
are some limits with the runtime version, but for the most part they
shouldn't be an issue. In short, the only up-front cost to move to a new
version of Access is the copy that you'll need for development.

"(E-Mail Removed)" wrote:

> On Feb 3, 11:01 pm, Tom van Stiphout <tom7744.no.s...@cox.net> wrote:
> > On Tue, 3 Feb 2009 17:15:38 -0800 (PST), gardenofsim...@gmail.com
> > wrote:
> >
> > As you found out: it don't work that way. VBA cannot use .NET
> > assemblies directly.
> > In a similar situation we wrote a .NET assembly and gave it a COM
> > wrapper. THEN you can reference that DLL from Access and call its
> > public interface.
> >
> > -Tom.
> > Microsoft Access MVP
> >
> > >Hi everyone!

> >
> > >I just wanted some opinions before I gave up on this solution
> > >altogether and found another way. I know that there are many ways to
> > >solve this problem, it's just that this one seemed simple and elegant
> > >(until it didn't work!)

> >
> > >The givens are that a) I must use Access 2000 and b) I am stuck
> > >with .net Framework 2.0. I cannot upgrade either of these products.
> > >I'm sorry. I realize that upgrading both would most likely solve this
> > >instantly.

> >
> > >So: working within these constraints, what I wanted to do was write a
> > >very short VBA module to encrypt a few strings using the SHA512
> > >algorithm.

> >
> > >I wanted to use the SHA512 class from the System.Security.Cryptography
> > >namespace:
> > >http://msdn.microsoft.com/en-us/libr...y.cryptography....

> >
> > >However, I can't get it to work.

> >
> > >1) I can add mscorlib.dll as a reference.
> > >2) I can create an instance of SHA512 -- Dim x As New SHA512

> >
> > >The problem occurs when I try to use the ComputeHash method. The code
> > >y = x.ComputeHash(z) causes VBA to return the runtime error "Invalid
> > >procedure call or argument".

> >
> > >When I look at the SHA512 class in Object Browser, it contains no
> > >members. This is really puzzling to me.

> >
> > >So my question is: why would the Object Browser show no members and
> > >yet VBA is willing to let me create an instance of this class?

> >
> > >Is there something simple I'm missing here? Or is this never going to
> > >work.

> >
> > >Thanks for your help.

> >
> > >C.

>
> Tom thank you SO much for pointing me in the right direction. I
> thought I was going to go mad from not being able to figure out why.
>
> C.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Access 2000 VBA with .net Framework 2.0 issue Tom van Stiphout Microsoft Access VBA Modules 0 4th Feb 2009 04:01 AM
Practical Issue with Access 2000 to Access 2007 Irshad Alam Microsoft Access 4 26th Aug 2008 07:38 PM
Access 2000 issue on Windows 2000 and NT4.0 =?Utf-8?B?R29yZG9u?= Microsoft Access External Data 1 16th Apr 2005 07:58 AM
Access is denied when calling a remote serviced component (framework 1.1->1.0 issue) Stan Microsoft ASP .NET 9 1st Oct 2004 01:55 AM
Access is denied when calling a remote serviced component (framework 1.1->1.0 issue) Stan Microsoft Dot NET 5 24th Sep 2004 10:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:15 PM.