You must Sign In to post a response.
  • Category: Visual Studio

    Getting Data Type Conversion Error

    In classic vb code, I am trying to get 8 digit value from textbox and assign it to recordset variable but I am Getting Data Type Conversion Error. Any ideas how can it be fixed? Make sure its classic VB6 .
    If Val(txtPOINT5) > 0 Then
    rstArHist("DiagP") = Val(txtPOINT5)
    End If
  • #756696
    hi
    change your datatype int to long or bigint

    Name : Dotnet Developer-2015
    Email Id : kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • #756698
    Not working, same error after changing data type

  • #756699
    Hai Sameer,
    Do you think you can assign the value to the record-set. Record-set is used to read the data and not to modify inside the record-set.
    So i think it will not work.
    If you want to set the data from the Record-Set, you can do this as:

    If Val(txtPOINT5) > 0 Then
    rstArHist.Fields("DiagP") = Val(txtPOINT5.Value)
    End If

    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com


  • Sign In to post your comments