Home > Software engineering >  Adodc1. Refresh what is wrong
Adodc1. Refresh what is wrong

Time:09-27

Private Sub cmdQurey_Click ()
Dim strQuery As String
StrQuery="Select * from Taoziyuan where 1=1"
If txtzhuose. Text & lt;> "" Then
StrQuery=strQuery & amp; "And" & amp; Txtzhuose. Text & amp; "Is not full"
End the If
Adodc1. RecordSource=strQuery
Adodc1. Refresh
The Exit Sub
Errhandler:
MsgBox "error number:" & amp; Err. Number & amp; "Error message:" & amp; Err, Description, vbExclamatio
End Sub

CodePudding user response:

The data refresh time wrong!

CodePudding user response:

What wrong all don't say
I guess, I guess, I guess:
Address if txtzhuose importer string is
Then spell good SQL statement is
 Select * from Taoziyuan where 1=1 and address is not full 

1. and
no Spaces before and after2. Address (txtzhuose. Text) no Spaces before and after the
3. full are you sure they aren't null ?

CodePudding user response:

StrQuery=strQuery & amp; This sentence is wrong? I want more query conditions, how to write a statement?

CodePudding user response:

refer to the second floor Tiger_Zhao response:
what wrong all don't say
I guess, I guess, I guess:
Address if txtzhuose importer string is
Then spell good SQL statement is
 Select * from Taoziyuan where 1=1 and address is not full 

1. and
no Spaces before and after2. Address (txtzhuose. Text) no Spaces before and after the
3. full are you sure they aren't null ?
strQuery=strQuery & amp; This sentence is wrong? I want more query conditions, how to write a statement?

CodePudding user response:

Private Sub cmdQurey_Click ()
Dim strQuery As String
If Checkpinzhong. Value=https://bbs.csdn.net/topics/1 Then
If strQuery="" Then
StrQuery="pinzhong like '% %'" + txtpinzhong. Text + ", "
The Else
StrQuery=strQuery & amp; "And pinzhong like '% %'" + txtpinzhong. Text + ", "
End the If
End the If
If Checkfengchan. Value=https://bbs.csdn.net/topics/1 Then
If strQuery="" Then
StrQuery="fengchanxing like '% %'" + txtfengchan. Text + ", "
The Else
StrQuery=strQuery & amp; "And fengchanxing like '% %'" + txtfengchan. Text + ", "
End the If
End the If
Adodc1. RecordSource="select * from Taoziyuan where" & amp; StrQuery
Adodc1. Refresh
The Exit Sub

Errhandler:
MsgBox "error number:" & amp; Err. Number & amp; "Error message:" & amp; Err, Description, vbExclamatio

End Sub
The first if wrong, why search out of blank, the second can be used

CodePudding user response:

You used the entire SQL Debug. Print output, copy the query analyzer, according to the error modification,
Other not much said, the careful can correct,

CodePudding user response:

refer to 6th floor Tiger_Zhao response:
. You used the entire SQL Debug Print output, copy the query analyzer, according to the error modification,
Other not much said, the careful can correct,
novice can't DEBUG,,, how to do

CodePudding user response:

Either learn to debug, or give up, there is no third choice,

CodePudding user response:

refer to the eighth floor Tiger_Zhao response:
either learn to debug, or give up, there is no third choice,
debug yes ah

CodePudding user response:

references 9 f liu9827885 response:
debug yes

copy to the query parser to execute
  • Related