I try to connect by ODBC 3.51 and I get connection and I can get data from MySQL database and show it in my VB 2008 Express Edition, but when I want to AddNew or Update something it gives me an error property "Item" is "ReadOnly" (about my rs).

This is my code and I do not know how to solve this problem.

Tel = Val(Me.TextBox1.Text)
        ssql = "SELECT * FROM clientes where PENDIENTE='Y' AND TELEFONO= " & Tel & " "
        
	conn = New ADODB.Connection
        rs = New ADODB.Recordset
        conn.CursorLocation = ADODB.CursorLocationEnum.adUseClient
        conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" & _
        "SERVER=localhost;" & "UID=root;" & "PWD=converged20;" & _
        "DATABASE=callcenter01;" & "READONLY=0" & "OPTION=3"
        conn.Open()
        rs.Open(ssql, conn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)
 

        rs.MoveFirst()
        If rs.EOF Then
            MsgBox("No existe registros de clientes ", 0)
        Else
            Me.TextBox14.Text = Me.DateTimePicker1.Text
            rs.Fields("CITA") = Val(Me.TextBox14.Text)
            rs.Update()
        End If

Thanks in advance for your help.

take a look at this line

rs.Fields("CITA") = Val(Me.TextBox14.Text)

change to

rs.Fields("CITA").value = Val(Me.TextBox14.Text)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.