VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form frmConDataControl 
   Caption         =   "ConDataControl"
   ClientHeight    =   4425
   ClientLeft      =   3705
   ClientTop       =   4815
   ClientWidth     =   5595
   LinkTopic       =   "Form1"
   ScaleHeight     =   4425
   ScaleWidth      =   5595
   Begin VB.Data Data1 
      Caption         =   "Data1"
      Connect         =   "dsn=imgpsql"
      DatabaseName    =   "imgpsql"
      DefaultCursorType=   0  'DefaultCursor
      DefaultType     =   2  'UseODBC
      Exclusive       =   0   'False
      Height          =   345
      Left            =   840
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   "casas.fotos_rep"
      Top             =   3480
      Width           =   2895
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   60
      Top             =   1320
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      DialogTitle     =   "Abrir fotografia"
      Filter          =   "*.bmp"
      InitDir         =   "\"
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Load BMP"
      Height          =   495
      Index           =   1
      Left            =   3240
      TabIndex        =   4
      Top             =   2700
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "AddNew"
      Height          =   495
      Index           =   0
      Left            =   1860
      TabIndex        =   3
      Top             =   2700
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      DataField       =   "id_foto"
      DataSource      =   "Data1"
      Height          =   285
      Left            =   1500
      TabIndex        =   2
      Top             =   180
      Width           =   975
   End
   Begin VB.Image Image1 
      DataField       =   "imagen"
      DataSource      =   "Data1"
      Height          =   1575
      Left            =   1680
      Stretch         =   -1  'True
      Top             =   840
      Width           =   2895
   End
   Begin VB.Label Label1 
      Caption         =   "Foto:"
      Height          =   195
      Index           =   2
      Left            =   120
      TabIndex        =   1
      Top             =   960
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "Identificativo:"
      Height          =   195
      Index           =   0
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   1215
   End
End
Attribute VB_Name = "frmConDataControl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit



Private Sub Command1_Click(Index As Integer)
    Select Case Index
        Case 0
        Data1.Recordset.MoveLast
        Text1.Text = Data1.Recordset.Fields("id_foto")
            Data1.Recordset.AddNew
            Data1.Recordset.Fields("id_foto") = Val(Text1.Text) + 1
         Case 1 'Carga Bmp
            CommonDialog1.ShowOpen
            If CommonDialog1.FileName <> "" Then
                Image1.Picture = LoadPicture(CommonDialog1.FileName)

            End If
    End Select
End Sub

