What's Wrong? Probably Simple 
Author Message
 What's Wrong? Probably Simple

Hello,
    I am trying to write a simple app to open and do the most basic
functions to a database.  (Namely open, read, and insert...possibly
delete later on) However everytime I run the program I get an assertion
failure?  I don't know much about DB programming especially in Visual
C++ 5/6...

//#include<afx.h>
#include<iostream.h>
//#include<windows.h>
#include<afxdao.h>

void main()
{
     CDaoDatabase md_DB; //pWorkspace;
     md_DB.Open("\\\\ab1-1-55\\c$\\test.mdb");
     if(md_DB.IsOpen())
     {
            md_DB.Close();
            cout << "closed the database" << endl;
            Sleep(10000);
       }

Quote:
}

I put the sleep in there to just kind of watch... everything happens it
waits th 10 secs. and then I get the assertion failure.  I presume I am
not closing everything?  Any help would be greatly appreciated.

Robert A. Thompson



Fri, 02 Feb 2001 03:00:00 GMT  
 What's Wrong? Probably Simple
Robert,

It maybe that you need to call AfxDaoTerm before you exit.

Craig Klementowski
remove shootspammers to send me email

Quote:

>Hello,
>    I am trying to write a simple app to open and do the most basic
>functions to a database.  (Namely open, read, and insert...possibly
>delete later on) However everytime I run the program I get an assertion
>failure?  I don't know much about DB programming especially in Visual
>C++ 5/6...

>//#include<afx.h>
>#include<iostream.h>
>//#include<windows.h>
>#include<afxdao.h>

>void main()
>{
>     CDaoDatabase md_DB; //pWorkspace;
>     md_DB.Open("\\\\ab1-1-55\\c$\\test.mdb");
>     if(md_DB.IsOpen())
>     {
>            md_DB.Close();
>            cout << "closed the database" << endl;
>            Sleep(10000);
>       }
>}

>I put the sleep in there to just kind of watch... everything happens it
>waits th 10 secs. and then I get the assertion failure.  I presume I am
>not closing everything?  Any help would be greatly appreciated.

>Robert A. Thompson



Fri, 02 Feb 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Probably a simple problem in 'C'

2. what's wrong with this simple program?

3. What's wrong with my simple program?

4. What's Wrong in This Simple One

5. Probably really simple but...

6. yea, its me again - another simple one (probably)

7. Simple (probably) C question...

8. Probably a simple question

9. Probably a Simple C Question for Everyone

10. Problem using atof (probably a simple question)

11. Probably simple error

12. New to BSTR and _bstr_t, probably very simple problem

 

 
Powered by phpBB® Forum Software