Necesito un programador que me ayude.

Tengo una Base de Datos en access, de la cual llama por medio de una Cédula Catastral, la información y trae una firma digital.. Pero que resulta.. Hay cédulas catastrales que posee por medio de un campo llamado firmas "firmas digitales" y otras que no lo posee... Yo lo que quiero es que al cargar la cedula catastral, te cargue las firmas que poseen y las que no poseen firmas...

Aqui les dejo mi programación y estoy que no se que hacer...

En el modulo 1 tengo esto:

Sub Cargar_Imagen()
Dim ADO_Connection As ADODB.Connection
Dim rs As ADODB.Recordset
Dim rs2 As ADODB.Recordset
Dim Stream As ADODB.Stream

'SELECION GENERAL DEL CICLO
'Set rs2 = New ADODB.Recordset
Set rs = New ADODB.Recordset
Set ADO_Connection = CurrentProject.Connection
'SQL = "SELECT * FROM dbo_V_colindantes where CEDULA_CATASTRAL_PREDIO = '4243215140413'"
' rs2.Open SQL, ADO_Connection, adOpenKeyset, adLockOptimistic
' If rs2.RecordCount = 0 Then
' S'et Leer_Imagen = Nothing
'rs2.Close
' Set rs2 = Nothing
' Exit Sub
' End If
' rs2.MoveFirst
Dim cedula As String
'Dim contador As Integer
'contador = 31
'While Not rs2.EOF
'cedula = Me.CEDULA_RUC.Value
cedula = Reports!Informe1![subinforme ColindantesyFirmas]!CEDULA_RUC.Value
SQL2 = "SELECT * FROM dbo_V_Firmas_propietario_ocupante where CEDULA_RUC = '" & cedula & "'"
rs.Open SQL2, ADO_Connection, adOpenKeyset, adLockOptimistic
Campo_Imagen = "FIRMA"
If rs.RecordCount = 0 Then

' Set Leer_Imagen = Nothing
rs.Close
Set rs = Nothing
Exit Sub
End If

rs.MoveFirst

Set Stream = New ADODB.Stream
' Especifica el tipo de datos ( binario )
Stream.Type = adTypeBinary
Stream.Open
' verifica con la función IsNull que el campo no tenga _
un valor Nulo ya que si no da error, en ese caso sale de la función
If IsNull(rs.Fields(Campo_Imagen).Value) Then
' GoTo error_Function
End If
' Graba los datos en el objeto stream
Stream.Write rs.Fields(Campo_Imagen).Value
' este método graba un archivo temporal en disco _
( en el app.path que luego se elimina )
'Stream.SaveToFile "C:\IMAGEN\PRUEBA.GIF", adSaveCreateOverWrite
Stream.SaveToFile "C:\IMAGEN\colindantes\" & cedula & ".GIF", adSaveCreateOverWrite
' Retorna la imagen a la función
'''''''''''''
Reports!Informe1![subinforme ColindantesyFirmas]!Imagen6.Picture = "C:/IMAGEN/colindantes/" & cedula & ".GIF"
'Imagen32.Picture = "C:/IMAGEN/colindantes/" & cedula & ".GIF"

'''''''''''
'Cierra el recordset y el objeto Stream
If rs.State = adStateOpen Then
rs.Close
End If
If Not rs Is Nothing Then
' Set rs = Nothing
End If
If Stream.State = adStateOpen Then
Stream.Close
End If
If Not Stream Is Nothing Then
Set Stream = Nothing
End If
'rs.Close

'Set rs = Nothing
'rs2.MoveNext
contador = contador + 1
'Wend

'MsgBox " Fin de Proceso"

End Sub

Añade tu respuesta

Haz clic para o