Student Summary (II) -- what are the single quotes in students and what are the student quotes?

Source: Internet
Author: User

Student Summary (II) -- what are the single quotes in students and what are the student quotes?

Student Summary (II)-What are the single quotes in students?

If you see this question, you may think that I am selling it. Let's take a look at this summary! Recently, I encountered a bottleneck in coding and asked a lot about

The single quotes of students finally brought me to the peak with the help of Lian Kang!

Code Section:

txtSQL = "select * from student_Info where class_NO = '" & comboClassno.Text &"'"Set mrc = ExecuteSQL(txtSQL, MsgText)      While (mrc.EOF = False)           comboSID.AddItem mrc!student_ID         mrc.MoveNextWendmrc.Close

Everyone must be curious about the two single quotes above! First, single quotes are symbols in SQL, while double quotes are symbols in vb!

   txtSQL = "select * from student_Info where class_NO ='" & comboClassno.Text &"'"

The instructor understands that "select * from student_Info where class_NO = '" With comboClassno. Text and "'". I understand why this writing is done, that is, connecting the three sentences with a connector. But I still cannot understand what it means!

I wrote it in my way and understood the code! This can only help you understand the meaning of the code and help you understand why you want to write it like this!


My idea is that the red double quotation marks are opposite. All the content inside is character, two green double quotation marks are opposite, and two blue single quotation marks are a pair.

1. Open your SQL statement and click the red button.



 

2. Right-click student_Info and select the first 200 lines to go to the editing page. Click Create query and copy the code ,!






3. the SQL statement on the front side cannot be identified and there is a syntax error. Delete the statement and click the query button, as shown in!


 



4. Delete "& comboClassno. Text &" and replace it with the required shift number, for example, 2 ,!




Now you have the expected results. The student IDs of Class 2 are 456 and 678, so we understand that single quotation marks and double quotation marks are really necessary!

 


Top
3
Step on
0
View comments

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.