Programming with VB causes a data type mismatch in standard expressions

Updated on technology 2024-08-05
4 answers
  1. Anonymous users2024-02-15

    private sub cha_click()dim sql as string

    sql = "select * from usage record where kahao='" & text1(0).text & "'or " & "(shijian>='" & text2(1).text & "' and shijian<='" & text3(2).

    text & "')"

    What is the data type of the shijian field, if it is a time type, it cannot be in single quotation marks, or should be changed to and, otherwise there will be many records with different card numbers.

    The SQL sentence is to get the query recordset.

    update is to modify this record, which control is bound to the shijian field? Besides, why do you want to modify it now, you don't know what the status of the query recordset is, what if the query recordset is empty? What if there are more than one?

    Remove it and see.

    Flushed? update doesn't work, and this sentence doesn't do anything.

    end sub

  2. Anonymous users2024-02-14

    Time is used between ...and try, I remember so.

  3. Anonymous users2024-02-13

    sql = "select * from usage record where kahao='" & text1(0).text & "'or " & "(shijian>='" & text2(1).text & "' and shijian<='" & text3(2).

    text & "')"

    Missing parentheses.

  4. Anonymous users2024-02-12

    Hello dear<>

    The answer you are looking for: The data type mismatch in the standard expression means that when you use the standard expression, the data type involved in the expression is inconsistent with the required data type. For example, if a standard expression requires an integer to be entered, but a string type of data is entered, a data type mismatch error will occur.

    In this case, you need to check the data type requirements in the standard expression, and then double-check whether the data type entered meets the requirements. If the entered data type does not meet the requirements, you need to convert the data type or change the data type to meet the requirements of the standard expression. For example, if a standard expression requires the input of integer data, but the input is of the quiet string type, you can use the type conversion function provided by the language to convert the string type to an integer type, such as the atoi() function in C++ and the int() function in Python.

    If you're not sure what type of data is required in a standard expression, you can check the documentation or consult the relevant technician.

Related questions
12 answers2024-08-05

Not sure what it does?

What are the specific requirements. >>>More

5 answers2024-08-05

Isn't it equivalent to data sorting? sql ?

13 answers2024-08-05

Picturebox also works well

Generally, the graphics of each chess piece are collected in a single diagram. >>>More

3 answers2024-08-05

private sub timer1_timer()= "Current Time:" + cstr(time)if = cstr(time) thenmsgbox "The countdown ends" >>>More

10 answers2024-08-05

Set the focus. For example, if you make the text box text1 focus in the program, you can enter the text directly in the text box without clicking the text box with the mouse to make it focus before entering the content. >>>More