| |

VerySource

 Forgot password?
 Register
Search
View: 664|Reply: 3

Why should I use SQL statements in VC?

[Copy link]

4

Threads

8

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-4 16:10:01
| Show all posts |Read mode
I used ODBC to connect three tables created by SQL, and used the following code in MFC
CString strSQL = "SELECT * from Course";
m_pSet-> m_pDatabase-> ExecuteSQL (strSQL);
Found that the ExecuteSQL () function does not return a value, so what can we do with it ???
Reply

Use magic Report

1

Threads

15

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-1-5 00:51:01
| Show all posts
For example, if you want to insert a record or update a record, what's the use of the return value? The success or failure of execution can be solved with try catch.
Reply

Use magic Report

4

Threads

8

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-1-5 09:36:01
| Show all posts
What should I do if I want to join two tables
Reply

Use magic Report

0

Threads

24

Posts

19.00

Credits

Newbie

Rank: 1

Credits
19.00

 China

Post time: 2020-1-5 10:09:01
| Show all posts
Generally speaking, VC uses a database, which will not be the main application. Look for a book on database programming.
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