Ver Mensaje Individual
  #6 (permalink)  
Antiguo 07/04/2008, 15:25
spiderman78
 
Fecha de Ingreso: abril-2008
Mensajes: 281
Antigüedad: 17 años
Puntos: 1
Re: agregar registros mysql

que tal adolfiten, ya cheque los q me comentas sobre las comillas y lo autonumero y la restriccion del NULL, pero ahora me manda error de 3709 q dice "no se puede utilizar la conexionpara realizar esta operacion. Esta cerrada o no es valida este contextos agrego el codigo para ver si todavia ando haciendo algo mal, gracias por la ayuda

Cita:
Private Sub Form_Load()

Dim CON As ADODB.Connection
Dim rt As ADODB.Recordset

Set CON = New ADODB.Connection
Set rt = New ADODB.Recordset
CON.CommandTimeout = 40
CON.CursorLocation = 1
'CON.ConnectionString = "server=localhost;driver=mysql;db=proyecto"
CON.Open "DRIVER={MySQL ODBC 3.51 Driver};DATABASE=EDMAC;SERVER=localhost;UID=root; PASSWORD=;PORT=3306;"

End Sub

Private Sub Agregar()

Set rt = New ADODB.Recordset
rt.Source = "tblclientes"

rt.Open "INSERT INTO tblclientes (id) values('" & Me.Text1.Text & "')"

End Sub