Home > Software engineering >  VB query VFP database pop-up missing operand errors
VB query VFP database pop-up missing operand errors

Time:12-22

 Private Sub Command1_Click () 
Adodc1. RecordSource="select * from the node temperature and humidity information table where date=#" & amp; DTPicker1. Value & amp; "#", "
Adodc1. Refresh
The Set DataGrid1. The DataSource=Adodc1
End Sub

Perform this control will pop-up missing operand errors, how to solve this?

CodePudding user response:

"Missing operand" the meaning of this is the lack of operands, means DTPicker1. This Value is null, the Value didn't know what's your DTPicker1 control controls, whether he has the Value attribute, this property Value is the Value of the date format?

CodePudding user response:

If there is the Value of this attribute, and DTPicker1. The Value of the Value is also the date format, estimates the Value is a string, you need to modify:
Adodc1. RecordSource="select * from the node temperature and humidity information table where date=#" & amp; CDate (DTPicker1 Value) & amp; "#", "
Amend the value to date type data,

CodePudding user response:

refer to the second floor u013249970 response:
if there is the Value of this attribute, and DTPicker1. The Value of the Value is also the date format, estimates the Value is a string, you need to modify:
Adodc1. RecordSource="select * from the node temperature and humidity information table where date=#" & amp; CDate (DTPicker1 Value) & amp; "#", "
Amend the value to date type data,

DTPicker format is dtpshortdate, database is VFP, according to your method was still the same error

CodePudding user response:

Your query the Value DTPicker1. The Value is null, then you what is the Value? Where did you get that first check this value does not exist, check if there is no reason, as long as there is this value (that is not null), it should be no problem,
Already asked you, you what is the value of, don't know your source of this value is bad to answer,

CodePudding user response:

reference 4 floor u013249970 response:
your query the Value DTPicker1. The Value is null, then you what is the Value? Where did you get that first check this value does not exist, check if there is no reason, as long as there is this value (that is not null), it should be no problem,
Already asked you, you what is the value of, don't know your the source of this value, not answer,

This value is a date type data, I use text1 text box can be displayed DTPicker, text1. Text=DTPicker. Value
DTPicker is a date type control
  • Related