| |

VerySource

 Forgot password?
 Register
Search
View: 1649|Reply: 10

How do I use ADO inside a control when writing an OCX control?

[Copy link]

1

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-3-23 08:30:01
| Show all posts |Read mode
I want to encapsulate a series of operations using ADO to access the database in ADO, but I don't know how to use ADO when writing controls, can anyone tell me !!
Reply

Use magic Report

1

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-7-2 11:15:01
| Show all posts
Sorry, I want to encapsulate it in OCX (MFC) :)
Reply

Use magic Report

0

Threads

36

Posts

22.00

Credits

Newbie

Rank: 1

Credits
22.00

 China

Post time: 2020-7-2 16:30:01
| Show all posts
#import directive can also be used in ocx
msdn2.microsoft.com/en-us/8etzzkb6.aspx-22k
Reply

Use magic Report

1

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-7-9 13:30:01
| Show all posts
#import "C:\Program Files\Common Files\System\ado\msado15.dll" rename_namespace("ARXADO") rename("BOF","adoBOF") rename("EOF","adoEOF")
This is my import, the compilation will not go wrong, but I define a _RecordsetPtr m_adoSet; he will tell me missing storage-class or type specifiers, please ask why
Reply

Use magic Report

0

Threads

55

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-7-11 22:15:01
| Show all posts
Missing header files included.
Reply

Use magic Report

1

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-7-14 23:00:01
| Show all posts
Reply

Use magic Report

1

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-7-14 23:15:01
| Show all posts
What header file?
Who can give me a tested code example? As long as it can be introduced!!! Brother I am almost depressed.
Reply

Use magic Report

1

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-7-19 14:15:01
| Show all posts
深蓝旅者!!!! Can you give me some sample codes? Or see what is wrong with mine. Thank you!! 1
Reply

Use magic Report

0

Threads

36

Posts

22.00

Credits

Newbie

Rank: 1

Credits
22.00

 China

Post time: 2020-7-20 03:15:01
| Show all posts
The problem with your code is that you specify the namespace when #import: ARXADO
Then bring it when you use it ARXADO::_RecordsetPtr
There are 2 other ways: use no_namespace when #import, or add under #import
using namespace ARXADO;
Reply

Use magic Report

1

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-7-31 10:45:01
| Show all posts
Using no_namespace, there is such an error:
e:\xgs\work\dataactivex\debug\msado15.tlh(171): error C2011:'LockTypeEnum':'enum' type redefinition
Use using namespace ARXADO,
He would say that there is no such a namespace as ARXADO
Using mine, there is nothing wrong with the call but it cannot be defined!!!!!
I have used ADO before. I have never seen such a problem. I don't know if there is a special way in OCX!!!!
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