Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
|
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 27th, 2006, 02:02 AM
Registered User
 
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Acess Violation in MSDART.dll 0xC0000005

Hello All Members,

I have some problem with VC++ code. I have created a DLL having a database class having connection pointer and recordset pointer. And I

have created Databse class (using ODBC) object into dllApp Class to make it use like global object.
But when i call my dll and debug my dll i got exception at database class destructor (while exiting fron DLL because this destructor is called

during the dll exitpoint).
//Databse.cpp
Datbase::~Database
{
        newDSNptr=NULL; //_ConnectionPtr
        newRECptr=NULL; //_RecordsetPtr ====>>>> Throws exception
        ::CoUninitialize();

}
Datbase::Database
{
        ::CoInitialize();
        newDSNptr=NULL; //_ConnectionPtr
        newRECptr=NULL; //_RecordsetPtr
    try
    {
        newDSNptr.CreateInstance((__uuidof(Connection)));
        newRECptr.CreateInstance((__uuidof(Recordset)));
        newDSNptr->Open(L"Provider=MSDASQL.1;Persist Security Info=False;DSN=NEW_DB_DSN;",L"",L"",0);
    }
    catch(_com_error &e)
    {
        AfxMessageBox(L"Error in New DataBse Connection\n" + e.Description());
        writeToFile(_T("CDatabase: ERROR: Error in New DataBse Connection:"));
    }
}
And in header file i have written like this
//Databse.h
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF", "EndOfFile")

"First-chance exception in App.exe: 0xC0000005: Access Violation."
"First-chance exception in App.exe (MSDART.DLL): 0xC0000005: Access Violation."

I have used all the try catch block for Database member function operation to avoid any unhandelled exception. If anybody can help me i will

be very thankful to that people. i am in serious problem plz. help me as soon as possible.

Thanks in advance.

Ambrish

Ambrish





Similar Threads
Thread Thread Starter Forum Replies Last Post
Acess denied prafullaborade XML 2 May 22nd, 2008 09:55 AM
Microsoft word and Acess keisha Access 3 February 15th, 2008 09:08 AM
Put info From VBForm to Acess? mivvb VB Databases Basics 4 August 9th, 2005 04:35 PM
Data acess with .NET btls BOOK: Professional C#, 2nd and 3rd Editions 1 June 14th, 2004 11:21 PM
how to acess java object in javascript ravikumar681 J2EE 0 May 25th, 2004 06:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.