Visual Basic - no se han especificado valores para algunos de los parametros requeridos

Life is soft - evento anual de software empresarial
 
Vista:

no se han especificado valores para algunos de los parametros requeridos

Publicado por Eled (1 intervención) el 19/08/2012 00:31:31
Hola amigos quisiera que me ayuden no puedo insertar como texto solo me permite como numerico, cuando deseo insertar como texto solo me sale un error de: no se han especificado valores para algunos de los parametros requiridos

y no me pasa eso cuando es numero!!!

Tengo la tabla notas en la columna tipo quisiera introducir aprobado o reprobado pero, no me permite solo acepta numeros y no texto
espero que me ayuden se les agradecere muchisimo
atte Edwin

Email: [email protected]

Tabla Notas
Idmatriculas de tipo texto (esta es llave de otra tabla)
Idcurso de tipo texto (esta es llave de otra tabla)
Nota1: de tipo numérico
Nota2: de tipo numérico
Nota3: de tipo numérico
Nota4: de tipo numérico
Promedio: de tipo numérico
Promedio1: de tipo numérico
Promedio2: de tipo numérico
Tipo: de tipo texto

Option Compare Text
Dim I As Long
Dim Nuevo As Boolean
Private RS As New ADODB.Recordset
Public IDM As String

‘-----------------------------------------------------------------------------

Public Sub RellenarTreeView()
On Local Error GoTo ELI
TreeView1.Nodes.Add , , "a", "Año: " + AANNIIOO, "p", "p"
'PRIMERO
TreeView1.Nodes.Add "a", tvwChild, "a1", "Primero", "q", "q"
RS.Open "SELECT ESTUDIANTE.APELLIDOS+' '+estudiante.NOMBRES,MATRICULA.IDMATRICULA FROM GRADOS INNER JOIN (ESTUDIANTE INNER JOIN MATRICULA ON ESTUDIANTE.IDALUMNA = MATRICULA.IDALUMNA) ON GRADOS.IDGRADO = MATRICULA.IDGRADO WHERE GRADOS.GRADO='PRIMERO' AND Year(FECHA)=" + AANNIIOO + " Order By 1", db, 3, 1, 1
Do While RS.EOF = False
TreeView1.Nodes.Add "a1", tvwChild, "a1" + RS(1), RS(0), "c", "a"
RS.MoveNext
Loop
Set RS = Nothing
'SEGUNDO así sucesivamente



‘------------------------------------------------------------

Private Sub RellenarLista(ByVal IdMatr As String)
On Local Error GoTo ELI
RS.Open Mio.Cadenita6 + IdMatr + "'", db, 3, 1, 1
Call Mio.RefrescarRS(RS)
If RS.RecordCount = 0 Then
Set RS = Nothing
MSHFlexGrid1.Clear
MSHFlexGrid1.Cols = 2
MSHFlexGrid1.Rows = 2
lblTotal.Caption = "0"
MSHFlexGrid1.ColWidth(0) = 0
MSHFlexGrid1.ColWidth(1) = 200
Exit Sub
End If
Set MSHFlexGrid1.Recordset = RS
Set RS = Nothing
MSHFlexGrid1.ColWidth(0) = 0
MSHFlexGrid1.FormatString = "|^MODULOS|^ORAL|^ESCRITO|^ORAL|^ESCRITO|^PROMEDIO"
MSHFlexGrid1.ColWidth(1) = 2350 'Curso
MSHFlexGrid1.ColWidth(2) = 830 'Nota1
MSHFlexGrid1.ColWidth(3) = 935 'Nota2
MSHFlexGrid1.ColWidth(4) = 830 'Nota3
MSHFlexGrid1.ColWidth(5) = 935 'Nota4
MSHFlexGrid1.ColWidth(6) = 1100 'Promedio
MSHFlexGrid1.ColWidth(7) = 0 'IdMatricula
lblTotal.Caption = Trim$(MSHFlexGrid1.Rows - 1)
Exit Sub
ELI:

MsgBox "Descripción=> " + Err.Description + Chr(13) + "Error Nº " + Trim$(Err.Number) + Chr(13) + "Procedimiento=> " + "RellenarLista", vbCritical, "ERROR=> " + Name

End Sub



‘--------------------------------------------------------------------------------

Private Sub CmdAgregar_Click()
On Local Error GoTo 0
If cmbCurso.Text = "" Then
MsgBox "Falta Seleccionar EL Curso...!", vbInformation
Exit Sub
End If
Dim N(1 To 5) As Integer
Dim a1, a2, m As String
Dim A, B As Integer

a1 = "Aprobado"
a2 = "Reprobado"
N(1) = Val(txtN1.Text)
N(2) = Val(txtN2.Text)
N(3) = Val(txtN3.Text)
N(4) = Val(txtN4.Text)
A = (N(1) + N(2)) / 2
B = (N(3) + N(4)) / 2
N(5) = (N(1) + N(2) + N(3) + N(4)) / 4

'-----------------------------

if n(5) >= 51 then
m = "Aprobado" ' es en esta parte no me permite introducir aprobado
else
m = "Reprobado" 'es en esta parte no me permite introducir reprobado
end if

'-------------------------------

If Nuevo = True Then
RS.Open "Select IDMATRICULA From NOTAS Where IDMATRICULA='" + IDM + "' And IDCURSO='" + Format$(Val(cmbCurso.ItemData(cmbCurso.ListIndex)), "00") + "'", db, 3, 1, 1
Mio.RefrescarRS RS

If RS.RecordCount > 0 Then
MsgBox "Las Notas del Curso " + Trim$(cmbCurso.Text) + ", Ya Esta Registrado...!", vbInformation
Set RS = Nothing
Exit Sub
End If

'-------------------------------------------aqui creo que esta el problema y no se que es------------------
Set RS = Nothing
Mio.Ejecutar "Insert Into NOTAS Values('" + IDM + "','" + Format$(Val(cmbCurso.ItemData(cmbCurso.ListIndex)), "00") + "'," + Trim$(N(1)) + "," + Trim$(N(2)) + "," + Trim$(N(3)) + "," + Trim$(N(4)) + "," + Trim$(N(5)) + "," + Trim$(A) + "," + Trim$(B) + "," + Trim$(m) + ")", I, db


ElseIf Nuevo = False Then
Mio.Ejecutar "Update NOTAS Set NOTA1=" + Trim$(N(1)) + ",NOTA2=" + Trim$(N(2)) + ",NOTA3=" + Trim$(N(3)) + ",NOTA4=" + Trim$(N(4)) + ",PROMEDIO=" + Trim$(N(5)) + ",PROMEDIO1=" + Trim$(A) + ",PROMEDIO2=" + Trim$(B) + ",TIPO=" + Trim$(m) + " Where IDMATRICULA='" + IDM + "' And IDCURSO='" + Format$(Val(cmbCurso.ItemData(cmbCurso.ListIndex)), "00") + "'", I, db
cmbCurso.Enabled = True
End If
RellenarLista IDM
Mio.Limpiar Me
Nuevo = True
cmbCurso.Enabled = True
Exit Sub
ELI:
MsgBox "Descripción=> " + Err.Description + Chr(13) + "Error Nº " + Trim$(Err.Number) + Chr(13) + "Procedimiento=> " + "CmdAgregar_Click", vbCritical, "ERROR=> " + Name
End Sub


MÓDULOS DE CLASE

Option Compare Text
‘----------------------------------------

Private Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function Verificar Lib "user32" Alias "FindWindowA" (ByVal lpszClassName As String, ByVal lpszWindow As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function SetMenuItemBitmaps Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal hBitmapUnchecked As Long, ByVal hBitmapChecked As Long) As Long
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

‘-----------------------------------------------------------------------------
Public Sub Ejecutar(Consulta As String, ByRef Afectar As Long, db As ADODB.Connection)
On Local Error GoTo ELI:
db.BeginTrans
db.Execute Consulta, Afectar
db.CommitTrans
Exit Sub
ELI:
MsgBox "Descripción... " + Err.Description + Chr(13) + "Error Nº " + Trim$(Err.Number) + Chr(13) + "Procedimiento=> " + "Ejecutar", vbCritical, "sistemas"
' db.RollbackTrans
End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

no se han especificado valores para algunos de los parametros requeridos

Publicado por jcmg (518 intervenciones) el 24/08/2012 07:52:02
quizas sean estas lineas

N(1) = Val(txtN1.Text)
N(2) = Val(txtN2.Text)
N(3) = Val(txtN3.Text)
N(4) = Val(txtN4.Text)

intentale asi:
N(1) = txtN1.Text
N(2) = txtN2.Text
N(3) = (txtN3.Text
N(4) = txtN4.Text
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

no se han especificado valores para algunos de los parametros requeridos

Publicado por Iñaki (502 intervenciones) el 28/08/2012 00:29:10
Creo que el problema es muy sencillo, faltan las comillas simples que encierran el campo tipo, de ahi que solo admita datos numericos.

fijate en como esta Trim$(m)

Mio.Ejecutar "Insert Into NOTAS Values('" + IDM + "','" + Format$(Val(cmbCurso.ItemData(cmbCurso.ListIndex)), "00") + "'," + Trim$(N(1)) + "," + Trim$(N(2)) + "," + Trim$(N(3)) + "," + Trim$(N(4)) + "," + Trim$(N(5)) + "," + Trim$(A) + "," + Trim$(B) + "," + Trim$(m) + ")", I, db
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar