Visual Basic - PERMISOS

Life is soft - evento anual de software empresarial
 
Vista:
sin imagen de perfil
Val: 27
Ha aumentado 1 puesto en Visual Basic (en relación al último mes)
Gráfica de Visual Basic

PERMISOS

Publicado por Mariano (51 intervenciones) el 12/01/2016 18:49:06
form1
formulario-Modificar-2


Hola me podrían ayudar con los permisos de usuarios es en VB 6.0


adjunto los formularios y detallo el código del formulario 2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Private Sub Command1_Click()
Dim RS As ADODB.Recordset
 Set RS = New ADODB.Recordset
 If Text1.Text = "" Then
MsgBox "Debes ingresar el ID del equipo", vbCritical
Exit Sub
End If
 With RS
 .ActiveConnection = "Provider=Microsoft.jet.OLEDB.4.0;Data Source=" & _
 App.Path & "\db1.mdb"
 .CursorType = adOpenStatic
 .CursorLocation = adUseClient
 .Open "Select USUARIO, PERMISO1,PERMISO2, PERMISO3,PERMISO4,PERMISO5 from CLAVE where id =" & Text1.Text
 
 End With
 
 ' cargar el Grid
 
 'Set MSHFlexGrid1.DataSource = RS
  '   MSHFlexGrid1.SelectionMode = flexSelectionByRow
 
    If RS.RecordCount = 0 Then
    MsgBox "RecordSet vacio, intente con otro id"
    Else
          Text2.Enabled = True
          Check1.Enabled = True
          Check2.Enabled = True
          Check3.Enabled = True
          Check4.Enabled = True
          Check5.Enabled = True
 
 
        If Not IsNull(RS.Fields.Item(0).Value) Then
            Text2.Text = RS.Fields.Item(0).Value
        End If
 
        If Not IsNull(RS.Fields.Item(2).Value) Then
           Check1.Value = RS.Fields.Item(2).Value
        End If
 
        If Not IsNull(RS.Fields.Item(3).Value) Then
             Check2.Value = RS.Fields.Item(3).Value
        End If
 
        If Not IsNull(RS.Fields.Item(4).Value) Then
             Check3.Value = RS.Fields.Item(4).Value
        End If
 
         If Not IsNull(RS.Fields.Item(5).Value) Then
             Check4.Value = RS.Fields.Item(5).Value
        End If
 
 
 
    End If
End Sub
 
Private Sub Command2_Click()
Dim RS As ADODB.Recordset
Set RS = New ADODB.Recordset
 With RS
 .ActiveConnection = "Provider=Microsoft.jet.OLEDB.4.0;Data Source=" & _
 App.Path & "\db1.mdb"
 .CursorType = adOpenStatic
 .CursorLocation = adUseClient
.Open "UPDATE CLAVE SET USUARIO=" & Chr(34) & Text2.Text & Chr(34) & ", PERMISO1=" & Chr(10) & Check1.Value & Chr(10) & ", PERMISO2=" & Chr(10) & Check2.Value & Chr(10) & ", PERMISO3=" & Chr(10) & Check3.Value & Chr(10) & ", PERMISO4=" & Chr(10) & Check4.Value & Chr(10) & ", PERMISO5=" & Chr(10) & Check5.Value & Chr(10) & " Where ID = " & Text1.Text
 
  If permiso1 = Check1.Caption = 1 Then
    usuario = permiso1 = Principal.Agregar_Proveedor.Enabled = False
 
    Else
    usuario = permiso1 = Principal.Agregar_Proveedor.Enabled = True
 
End If
 
 
MsgBox ("Modificacion exitosa!")
 
End With
End Sub
 
Private Sub Form_Load()
 
    Text1.Enabled = True
    Text2.Enabled = False
    Check1.Enabled = False
    Check2.Enabled = False
    Check3.Enabled = False
    Check4.Enabled = False
    Check5.Enabled = False
 
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