Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/02/2007, 08:04
rous_1812
 
Fecha de Ingreso: diciembre-2005
Mensajes: 74
Antigüedad: 18 años, 5 meses
Puntos: 0
tipo de dato char

hola por favor ayudenme con este error
tengo una tabla que se llama periodo lectivo
el campo per_codigo char(10)
este campo estoy haciendo que se genere
con esta funcion

Public Function Busca_Sgte_Codigo(Tabla As String, Campo_Codigo As String) As String
On Error GoTo maneja_error
abrir_odbc


RS.Open ("select isnotnull(max(" & Campo_Codigo & " as variant ),0) from " & Tabla), cn, adOpenKeyset, adLockOptimistic
If Not RS.EOF Then
Busca_Sgte_Codigo = Str(CInt(RS.Fields(0)) + 1)
End If
RS.Close

Exit Function
maneja_error:
If Err = -2147467259 Then
Abrir_Base
'FLAbrir_Base
Resume
Exit Function
End If

MsgBox "Error No. " + Str(Err) + " : " + Error, vbCritical, "Mensaje del Sistema"
Screen.MousePointer = 0
GF_In_Maneja_Error True
end sub

solo llega hasta esta linea
RS.Open ("select isnotnull(max(" & Campo_Codigo & " as variant ),0) from " & Tabla), cn, adOpenKeyset, adLockOptimistic

y se bota al mensaje de error
nunca entra al if
verificque se se conecta y efectivamente se conecta, no se donde es el error

por favor ayudenme