| |

VerySource

 Forgot password?
 Register
Search
View: 663|Reply: 6

DAO database programming out of the VC environment

[Copy link]

1

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-2-12 13:00:01
| Show all posts |Read mode
I used the MFC CDaoDatabase class to create and access the access database, but the abnormal error is displayed after leaving the environment. Is there any dynamic link library or file missing? Brother's software is very urgent, thank you.
Reply

Use magic Report

0

Threads

32

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 Invalid IP Address

Post time: 2020-4-11 15:30:02
| Show all posts
MFC CDaoDatabase uses ODBC to connect data, so no matter you are on your machine or someone else's machine, there should be no shortage of data DLLs, because ODBC is a public interface, and every Microsoft Windows has a driver to access the database .

Then the problem goes to other aspects, it may be caused by using other functions of MFC. For example, you may use "Use MFC in a Shared DLL" when compiling, then please use static library ( Static library) way to use MFC. If you compile the program to another PC and can not run normally, it may be that some dlls used by some controls are installed on your computer, and that dll is not in other PCs. In the VC ++ resource manager, see if the dll corresponding to the control you use is also available on other PCs. If not, copy the past.
Reply

Use magic Report

1

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-4-14 15:30:01
| Show all posts
The upstairs said it was good, but I compiled a separate program, just opened the database, or it still reported an error
Reply

Use magic Report

1

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-4-14 15:45:01
| Show all posts
The upstairs makes sense, but I compiled a program separately, and it would be wrong to open the database with CDaoDatabase.
Reply

Use magic Report

0

Threads

32

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-4-15 11:45:01
| Show all posts
Are you in debug mode, try to build a release?
Or modify or delete something and try again. For example, don't connect to the database and see if it reports an error.
Reply

Use magic Report

0

Threads

55

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-4-28 11:15:01
| Show all posts
Debug to see which line caused it.
Reply

Use magic Report

1

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-6-9 14:00:01
| Show all posts
Compile and run normally, that is, you can't leave the vC environment
My code
CDaoDatabase db1;
CString name;
name="Transmitter 1";
db1.Open(name);
CString str;
str=db1.GetName();
MessageBox(str);
db1.Close();
Written under a command of the class, the younger brother is very anxious, forget the masters’ enlightenment
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list