SELECT *
The FROM StudentInfo
WHERE StudentClassID Like '% % str1 AND StudentDepart="str2";
This is my play, I do not know why did not achieve the
CodePudding user response:
SELECT *The FROM StudentInfo
WHERE StudentClassID Like '% "& amp; Str1 & amp;" % 'AND StudentDepart=' "& amp; Str2 & amp;" '
CodePudding user response:
I changed in the ADODC attributes or noSELECT *
The FROM StudentInfo
WHERE StudentClassID Like '% "& amp; Str1 + "& amp; 'AND StudentDepart=' "& amp; Str2 & amp;" ';
CodePudding user response:
Like '% "& amp; Str1 & amp;" % 'AND StudentDepart=' "& amp; Str2 & amp;" 'CodePudding user response:
SELECT *The FROM StudentInfo
WHERE StudentClassID Like '% "& amp; Str1 & amp;" % 'AND StudentDepart=' "& amp; Str2 & amp;" '
Yes, this time or not, please do. Thank you for your help
CodePudding user response:
Entangled with this problem for a long time, want to cry, crazy!CodePudding user response:
The statement did not say that have no eligible recordsCodePudding user response:
Search field, or query record?CodePudding user response:
RecordCodePudding user response:
SQL="select... The from... Where the field name like "& amp; "' beginning with known string" & amp; "% '"CodePudding user response:
Vc access ado where variable stringCodePudding user response:
Vc access ado where variable stringCodePudding user response:
Now that use the variable, will not be able to assign attributes, when the design need to assignment in your code,Private Sub Command1_Click ()
Str1=...
Str2=...
Adodc1. RecordSource="SELECT *" & amp; _
"FROM StudentInfo" & amp; _
"WHERE StudentClassID Like '%" & amp; Str1 & amp; "% '" & amp; _
"AND StudentDepart='" & amp; Str2 & amp; "'
"Adodc1. Refresh
End Sub
CodePudding user response:
Now that use the variable, will not be able to assign attributes, when the design need to assignment in your code,Private Sub Command1_Click ()
Str1=...
Str2=...
Adodc1. RecordSource="SELECT *" & amp; _
"FROM StudentInfo" & amp; _
"WHERE StudentClassID Like '%" & amp; Str1 & amp; "% '" & amp; _
"AND StudentDepart='" & amp; Str2 & amp; "'
"Adodc1. Refresh
End Sub