Visual basic

BUENAS NOCHES ! Me sale un error al dale al boton para hacer una busqueda de cedula en vb6 "no se han especificado valores para alguno de los parametros requeridos"
Private Sub cmbbuscar_Click()
cedcompleta = cmbced + txtced
If Trim(txtced.Text) = "" Then
MsgBox "Debe introducir una cedula para realizar la busqueda", vbInformation + vbOKOnly
txtced.SetFocus
Else
If cmbced.Text = "" Then
MsgBox "Campo incompleto seleccione tipo de CI o RIF", vbInformation + vbOKOnly
cmbced.SetFocus
Else
sql = "Select CLNombre,CLFechaNac,CLEsatura,CLPeso,CLDir,CLSexo,CLEdoCIvil FROM TCliente where CLCIRif= '" & cedcompleta & "' "
Set rs = New ADODB.Recordset
rs.Open sql, db, adOpenStatic (JUSSSTO AQUI ME MARCA AMARILLO COMO ERROR)
If Not (rs.EOF Or rs.BOF) Then 'se encontro la cedula
txtnombre.Text = rs!CLNombre
dtpFechaNac.Value = rs!CLFechaNac
txtestatura.Text = rs!CLEstatura
txtpeso.Text = rs!CLPeso
txtdireccion.Text = rs!CLDir
cmbsexo.Text = rs!CLSexo 'en el combo box nose si trae .value??
cmbedocivil.Text = rs!CLEdoCivil
Else 'no lo encontro
    If MsgBox("Cedula o Cliente no encontrado,desea registrarlo?", vbInformation + vbYesNo) = vbYes Then
    txtnombre.Enabled = True
    dtpFechaNac.Enabled = True
    cmbsexo.Enabled = True
    cmbedocivil.Enabled = True
    txtestatura.Enabled = True
    txtpeso.Enabled = True
    txtdireccion.Enabled = True
    txtemail.Enabled = True
    txttlfhab.Enabled = True
    txttlfofi.Enabled = True
    txttlfcel.Enabled = True
    End If
End If
End If
End If
End Sub
Private Sub Form_Load()
Set rs = New ADODB.Recordset
Set db = New ADODB.Connection
    db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ProyectoSeguros\dbseguros.mdb;Persist Security Info=False"
txtnombre.Enabled = False
dtpFechaNac.Enabled = False
cmbsexo.Enabled = False
cmbedocivil.Enabled = False
txtestatura.Enabled = False
txtpeso.Enabled = False
txtdireccion.Enabled = False
txtemail.Enabled = False
txttlfhab.Enabled = False
txttlfofi.Enabled = False
txttlfcel.Enabled = False
End Sub

1 Respuesta

Respuesta
1
Pues nose si te falte el adLockOptimistic:
  Rs. Open sql, db, adOpenStatic, adLockOptimistic
O talves un campo esta mal escrito por eso quisiera saber si me podrias proporcionar tu formulario y bd para checar porque te marca ese error.
si me da su correo conmucho gusto le amndo el proyecto comprimido! logre solucionar ese inconveniente! pero ahora tengo OTRO NUEVO a la hora de "INCLUIR UN CLIENTE" no me lo incluye en la base de datos me da error en db.excecute sql
mi correo es [email protected]
aki le dejo todos los codigos del proyecto, si me da su correo le envio el proyecto para q lo verifique mejor y me ayude! se lo agradeceria
MODULO
Public db As ADODB.Connection
Public rs As ADODB.Recordset
Public rs1 As ADODB.Recordset
Public cm As ADODB.Command
Public SQL As String
MDI FORM       (LOAD)
Private Sub Adodc1_WillMove(ByVal adReason As ADODB.EventReasonEnum, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
End Sub
Private Sub MDIForm_Load()
Set db = New ADODB.Connection
    db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ProyectoSeguros\dbseguros.mdb;Persist Security Info=False"
End Sub
Private Sub mnuclientes_Click()
frmcliente.Show
End Sub
FORM LOAD .....el form load de CLIENTE
Private Sub Form_Load()
Set rs = New ADODB.Recordset
Set db = New ADODB.Connection
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ProyectoSeguros\dbseguros.mdb;Persist Security Info=False"
SOpt = dbSQLpasstrhough
txtnombre.Enabled = False
dtpFechaNac.Enabled = False
cmbsexo.Enabled = False
cmbedocivil.Enabled = False
txtestatura.Enabled = False
txtpeso.Enabled = False
txtdireccion.Enabled = False
txtemail.Enabled = False
txttlfhab.Enabled = False
txttlfofi.Enabled = False
txttlfcel.Enabled = False
cmdmodificar.Enabled = False
cmdguardar.Enabled = False
End Sub
Private Sub cmdguardar_Click() 'boton para guardar, aqui no me incluye en la base de datos
If Trim(txtnombre.Text) = "" Then
MsgBox ("Debe colocar un nombre"), vbInformation + vbOKOnly
txtnombre.SetFocus
Else
If Trim(dtpFechaNac.Value) = "" Then
MsgBox ("Debe seleccionar una FECHA DE NACIMIENTO"), vbInformation + vbOKOnly
dtpFechaNac.SetFocus
Else
If Trim(cmbsexo.Text) = "" Then
MsgBox ("La opcion sexo esta vacio"), vbInformation + vbOKOnly
cmbsexo.SetFocus
Else
If Trim(cmbedocivil.Text) = "" Then
MsgBox ("Debe selecionar un ESTADO CIVIL"), vbInformation + vbOKOnly
cmbedocivil.SetFocus
Else
If Trim(txtdireccion.Text) = "" Then
MsgBox ("Debe introducir una DIRECCION"), vbInformation + vbOKOnly
txtdireccion.SetFocus
Else
If Trim(txtemail.Text) = "" Then
MsgBox ("Debe seleccionar un E MAIL"), vbInformation + vbOKOnly
txtemail.SetFocus
Else
If Trim(txttlfhab.Text) = "" Then
MsgBox ("Debe introducir un TELEFONO DE HABITACION"), vbInformation + vbOKOnly
txttlfhab.SetFocus
Else
If Trim(txttlfofi.Text) = "" Then
MsgBox ("Debe introducir un TELEFONO DE OFICINA"), vbInformation + vbOKOnly
txttlfofi.SetFocus
Else
If Trim(txttlfcel.Text) = "" Then
MsgBox ("debe introducir un CELULAR"), vbInformation + vbOKOnly
txttlfcel.SetFocus
cedcompleta = cmbced + txtced
 SQL = " insert into TCLIENTE (CLCIRif,CLNombre,CLFechanac,CLSexo,CLEdoCivil,CLEstatura,CLPeso,CLDir,CLTlfHab,CLTlfOfic,CLTlfCel,CLEmail)" _
    & " values ('" & cedcompleta & "', '" & txtnombre.Text & "','" & dtpFechaNac.Value & "', '" & cmbsexo.Text & "','" & cmbedocivil.Text & "','" & txtestatura.Text & "','" & txtpeso.Text & "','" & txtdireccion.Text & "','" & txttlfhab.Text & "','" & txttlfofi.Text & "','" & txttlfcel & "','" & txtemail.Text & "')"
 db.Execute SQL, SOpt
     MsgBox "Ciudad Incluida Exitosamente", vbInformation, "Inclusion de Registro"
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
Ya te envie un correo electronico a tu cuenta, para que ahi me puedas dejar tu archivo comprimido.
No olvides Cerrar y Calificar la respuesta, si necesitas algo más, con gusto estare aqui para ayudarte.

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas