Jump to content

Can't update my Data Base with ODBC

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
Elmismo

Elmismo

    Newbie

  • Members
  • Pip
  • 1 posts
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


	

when I put rs.fields("fieldName") I get the readOnly Error.

Thanks in advance for your help

#2
LCD

LCD

    Newbie

  • Members
  • PipPip
  • 15 posts
cool code..