0

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.

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by dickersonka
0

take a look at this line

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

change to

rs.Fields("CITA").value = Val(Me.TextBox14.Text)
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.