PROBLEMAS AL CREAR REGISTRO EN BD
Publicado por vlg (37 intervenciones) el 30/06/2004 09:02:30
EL CODIGO QUE UTILIZO ES EL SIGUIENTE:
dim miOleDbconexion As OleDbConnection
Dim miOleDbcommand As OleDbCommand
Dim inserta As String, ejecuta As Integer
inserta = "insert into nombres(nombre,id) values ('Vicentin',33)"
miOleDbconexion = New OleDbConnection ("Provider=microsoft.Jet.OLEDB.4.0.;Data Source=C:\Inetpub\wwwroot\prueba_altas.mdb")
miOleDbconexion.Open()
miOleDbcommand = New OleDbCommand(inserta, miOleDbconexion)
ejecuta = miOleDbcommand.ExecuteNonQuery
If ejecuta > 0 Then
Response.Write("ya esta")
End If
miOleDbconexion.Close()
miOleDbconexion = Nothing
miOleDbcommand = Nothing
EL ERROR QUE ME RETORNA ES EL SIGUIENTE :
"La operación debe usar una consulta actualizable. "
EL INSERT INTO QUE UTILIZO ES CORRECTO YA QUE LO HE PROBADO EN UNA MACRO DE ACCESS , NO TENGO NI IDEA DE PORQUE ME RETORNA ESTE ERROR ¿ALGUIEN ME PUEDE GUIAR?
MUCHAS GRACIAS
dim miOleDbconexion As OleDbConnection
Dim miOleDbcommand As OleDbCommand
Dim inserta As String, ejecuta As Integer
inserta = "insert into nombres(nombre,id) values ('Vicentin',33)"
miOleDbconexion = New OleDbConnection ("Provider=microsoft.Jet.OLEDB.4.0.;Data Source=C:\Inetpub\wwwroot\prueba_altas.mdb")
miOleDbconexion.Open()
miOleDbcommand = New OleDbCommand(inserta, miOleDbconexion)
ejecuta = miOleDbcommand.ExecuteNonQuery
If ejecuta > 0 Then
Response.Write("ya esta")
End If
miOleDbconexion.Close()
miOleDbconexion = Nothing
miOleDbcommand = Nothing
EL ERROR QUE ME RETORNA ES EL SIGUIENTE :
"La operación debe usar una consulta actualizable. "
EL INSERT INTO QUE UTILIZO ES CORRECTO YA QUE LO HE PROBADO EN UNA MACRO DE ACCESS , NO TENGO NI IDEA DE PORQUE ME RETORNA ESTE ERROR ¿ALGUIEN ME PUEDE GUIAR?
MUCHAS GRACIAS
Valora esta pregunta


0