![]() |
Problema con MySql Tengo un problema, al querer conectar una BD en MySql con Visual Basic me manda error de que la base de datos es de solo lectura, ¿como quito esa condicion? |
Re: Problema con MySql Bueno aqui mas bien creo que es la forma en que abres el Recordset, Puedes postearlo? Saludos <center><a href="http://www.forosdelweb.com/comment_usr.asp?usr=urjose"> <img border="0" src="http://pcmasmas.com.ar/foro/images/avatars/043.gif"></a></center> |
Re: Problema con MySql hola, mira bajé este codigo de internet: Option Explicit Dim sql As String Public myCon As New ADODB.Connection Public myCmd As New ADODB.Command Public myRS As New ADODB.Recordset Private Sub cmdsig_Click() If Not myRS.BOF Then myRS.MoveNext If myRS.EOF And myRS.RecordCount > 0 Then Beep myRS.MoveLast End If Mostra_dados End Sub Private Sub Form_Load() On Error GoTo Error sql = "SELECT * FROM categoria" myCon.Open "DSN=MySql sistema" With myCmd Set .ActiveConnection = myCon .CommandType = adCmdText .CommandText = sql End With With myRS .LockType = adLockPessimistic .CursorType = adOpenKeyset .CursorLocation = adUseClient .Open myCmd End With myRS.MoveFirst Mostra_dados On Error GoTo 0 Form_Load_Exit: Exit Sub Error: MsgBox Err.Number & vbCrLf & Err.Description, vbExclamation, "Erro em [Form_Load]" End Sub Private Sub Mostra_dados() On Error GoTo Error Text1.Text = myRS("clave_cat") If IsNull(myRS("descripción")) Then Text2.Text = "" Else Text2.Text = myRS("descripcion") End If On Error GoTo 0 Mostra_dados_Exit: Exit Sub Error: MsgBox Err.Description, vbExclamation, "Erro em [Mostra_dados]" End Sub Private Sub cmdnuevo_Click() Dim iConta As Integer Dim icodigo As String On Error GoTo Error Text1.Text = "" Text2.Text = "" myRS.MoveLast icodigo = Val(myRS("clave_cat")) + 1 myRS.AddNew Text1.Text = CStr(icodigo) Text1.SetFocus On Error GoTo 0 cmdnuevo_Exit: Exit Sub Error: MsgBox Err.Description, vbExclamation, "Erro em [cmdnuevo]" End Sub Private Sub cmdguardar_Click() On Error GoTo Error myRS("clave_cat") = "" & Text1.Text myRS("descripcion") = "" & Text2.Text myRS.Update MsgBox "Operação realizada com sucesso !", vbInformation, "Salvar Inclusão/Alteração" On Error GoTo 0 cmdguardar_Exit: Exit Sub Error: MsgBox Err.Description, vbExclamation, "Erro em [cmdguardar]" End Sub este es el que me da broncas, y veces pone solo escritura y a veces no deja guardar |
| La zona horaria es GMT -6. Ahora son las 22:53. |
Desarrollado por vBulletin® Versión 3.8.7
Derechos de Autor ©2000 - 2026, Jelsoft Enterprises Ltd.