SQl2000 / VB6 ADO, cryptacquirecontext error

Posted on 2002-07-01
Last Modified: 2007-12-19

Hi Guys

Having a problem where i'm happily running my VB6 application against a sql2000 database.

My VB6 application will do a certain number iterations (reading from a recordset, and then inserting records into a table), and then it
will fall over with the following error message.

Run Time Error ='2147467259 (80004005)' :

CryptoAPI function 'CryptAcquireContext' failed. Error 0x8009001d:
(Error description unavailable)

At this point, I try closing the ADO connection, and re-opening, and I get the same error.

Whenever I try to load another windows program (i.e. Windows Explorer), I get a 'not enough memory to load program' error

I know that I have memory avaliable, (at least 80mb is being reported in the 'Free Physical Memory').

If I try running the SQL Insert statment in SQL Query Analyser, the insert works perfectly. (And I can also disconnect / reconnect to the SQL Server)

The only way to get my VB6 App to run the SQL Insert line is to stop the SQL Server process, and re-start it.

Obviously this is not a great solution, as my code is running on a client's machine which I do not have control over.

I've looked on newsgroups, and forums, and have come across a few references to this problem, yet none of them have had definative answers.

Can anybody help me please?????

Question by:sb8gq
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7121626
This what i found:

I think that you have the protocol encryption enabled, which uses the CryptoAPI. Unless you need this, you should disable it.
Independently of this, I could solve some problems with the CryptoAPI by
1) ensuring every user had full permissions to all the Crypto Hives in the registry
2) ensuring that no invalid/unknown users existed in the registry permissions for that hives.


Author Comment

ID: 7121646
Thanks for replying so quickly.

I'm not explicity using the Crypto API, so how do I disable the protocol encryption??

LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 400 total points
ID: 7121651
Start the "Server Network Utility" on the "Microsoft SQL Server" menu (Start->Program Files  is the default location). You will find the option in the first tab.

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.


Author Comment

ID: 7125332
The option there does not allow you to explicitly set 'no encryption', only to enforece encryption.

I have tried various protocols and still no luck :(


Author Comment

ID: 7125436
The option there does not allow you to explicitly set 'no encryption', only to enforece encryption.

I have tried various protocols and still no luck :(

LVL 49

Expert Comment

ID: 8451612
Upon review of the comments here, I am recommending this disposition:

        points to angelIII

Please post a comment if you disagree.

DanRollins -- EE database cleanup volunteer

Expert Comment

ID: 8492645
per recommendation.

Community Support Moderator @Experts Exchange

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Azure - monitoring who deletes records in a table 2 31
MSSQL join different row from other table 14 65
Need help with a query 3 36
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

685 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