Professional Documents
Culture Documents
Aplicacion Ing Civil
Aplicacion Ing Civil
Módulos:
Declaraciones
Global base As New ADODB.Connection
Global RsUsuarios As New ADODB.Recordset
Global MU2 As Double
Sentencias
Sub main()
With base
.CursorLocation = adUseClient
.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db1.mdb;Persist
Security Info=False"
LoginForm.Show
End With
End Sub
Sub usuario()
With RsUsuarios
If .State = 1 Then .Close
.Open "select * from usuarios", base, adOpenStatic, adLockOptimistic
End With
End Sub
Formulario login:
Else
If !clave = Trim(txtclave.Text) Then
Unload Me
frmPrincipal.Show
Else
MsgBox "clave incorrecta", vbInformation, "aviso"
End If
End If
End With
End Sub
End Sub
Codificación:
Else
M2.Text = Val(txtLuz1.Text) * Val(txtLuz1.Text) * Val(WU.Text) / 14
End If
MU2 = Val(M2.Text)
M3.Text = Val(txtLuz1.Text) * Val(txtLuz1.Text) * Val(WU.Text) / 9
M4.Text = Val(txtluz2.Text) * Val(txtluz2.Text) * Val(WU.Text) / 9
End Sub
Else
MsgBox "refuerzo doble", vbInformation, "aviso"
End If
cmdRS.Enabled = True
cmdSiguiente.Enabled = True
cmdDR.Enabled = True
cmdguardar.Enabled = True
End Sub
End Sub
5. Base Datos:
Global MU2, GWD, GWL, GWU, Mom1, Mom2, Mom3, Mom4, Mom5, Mom6 As Double
'centro de luz'
Global AAcero, pmax, pmin, AAsmin, pbal, AAsmax As Double
Global b, d, Fy, Fc, MU, b1, cuan As Double
'extremo izquierdo'
Global AAceroi, pmaxi, pmini As Double
Global bi, di, Fyi, Fci, MUi, b1i As Double
Sub Proyecto()
With rsProyectos
If .State = 1 Then .Close
.Open "select * from Proyectos", base, adOpenStatic, adLockOptimistic
End With
End Sub
Sub tramo()
With Rstramos
If .State = 1 Then .Close
.Open "select * from Tramos", base, adOpenStatic, adLockOptimistic
End With
End Sub
Sub refuerzo()
With Rsrefuerzos
If .State = 1 Then .Close
.Open "select * from refuerzos", base, adOpenStatic, adLockOptimistic
End With
End Sub
Sub detalleref()
With Rsdetallerefuerzo
If .State = 1 Then .Close
.Open "select * from detalle_refuerzo", base, adOpenStatic, adLockOptimistic
End With
End Sub
Sub varilla()
With Rsvarillas
If .State = 1 Then .Close
.Open "select * from varillas", base, adOpenStatic, adLockOptimistic
End With
End Sub
v1 = Round(AAcero / 0.71, 0) + 1
lblv1.Caption = v1 & " " & "Var"
v2 = Round(AAcero / 1.29, 0) + 1
lblv2.Caption = v2 & " " & "Var"
v3 = Round(AAcero / 1.99, 0) + 1
lblv3.Caption = v3 & " " & "Var"
v4 = Round(AAcero / 2.84, 0) + 1
lblv4.Caption = v4 & " " & "Var"
v5 = Round(AAcero / 5.09, 0) + 1
lblv5.Caption = v5 & " " & "Var"
10.Refuerzo doble
v1 = Round(Val(txtASc.Text) / 0.71, 0) + 1
Lbl1.Caption = v1 & " " & "Var"
v2 = Round(Val(txtASc.Text) / 1.29, 0) + 1
lbl2.Caption = v2 & " " & "Var"
v3 = Round(Val(txtASc.Text) / 1.99, 0) + 1
lbl3.Caption = v3 & " " & "Var"
v4 = Round(Val(txtASc.Text) / 2.84, 0) + 1
lbl4.Caption = v4 & " " & "Var"
v5 = Round(Val(txtASc.Text) / 5.09, 0) + 1
lbl5.Caption = v5 & " " & "Var"
varilla
detalleref
With Rsdetallerefuerzo
.Requery
.AddNew
!N°_varilla = 1
!Id_refuerzo = "Doble"
!N_varilla = Lbl1.Caption
!Condicion = lblcon1.Caption
.AddNew
!N°_varilla = 2
!Id_refuerzo = "Doble"
!N_varilla = lbl2.Caption
!Condicion = lblcon2.Caption
.AddNew
!N°_varilla = 3
!Id_refuerzo = "Doble"
!N_varilla = lbl3.Caption
!Condicion = lblcon3.Caption
.AddNew
!N°_varilla = 4
!Id_refuerzo = "Doble"
!N_varilla = lbl4.Caption
!Condicion = lblcon4.Caption
.AddNew
!N°_varilla = 5
!Id_refuerzo = "Doble"
!N_varilla = lbl5.Caption
!Condicion = lblcon5.Caption
.Update
.Requery
End With
End Sub
cmdGuardar.Enabled = False
End Sub
With RsUsuarios
.Requery
.AddNew
!Id = txtNId.Text
!Clave = txtNClave.Text
.Update
.Requery
End With
End Sub
With rsProyectos
.Requery
.AddNew
!Id_Proyecto = txtIDProy.Text
!CV = Val(txtWD.Text)
!CM = Val(txtWL.Text)
!CU = Val(txtWU.Text)
!MO1 = Val(txtm1.Text)
!MO2 = Val(txtm2.Text)
!MO3 = Val(txtm3.Text)
!MO4 = Val(txtm4.Text)
!MO5 = Val(txtm5.Text)
!MO6 = Val(txtm6.Text)
.Update
.Requery
End With
Unload Me
End Sub
With Rstramos
.Requery
.AddNew
!Id_Proyecto = DCproyectotramo.Text
!Id_Tramos = txtIdTramo.Text
!L_D = Val(txtd.Text)
!A_Acero = Val(txtAs.Text)
!C_B1 = Val(txtB1.Text)
!Cuantia = Val(txtp.Text)
!Cuantia_min = Val(txtpmin.Text)
!Cuantia_max = Val(txtpmax.Text)
!Cuantia_balanc = Val(txtpbal.Text)
!A_Acero_min = Val(txtAsmin.Text)
!A_Acero_max = Val(txtAsmax.Text)
.Update
.Requery
End With
Unload Me
End Sub
Private Sub Form_Load()
Proyecto
Set DCproyectotramo.RowSource = rsProyectos
DCproyectotramo.BoundColumn = "Id_proyecto"
DCproyectotramo.ListField = "Id_proyecto"
txtd.Text = d
txtB1.Text = b1
txtp.Text = cuan
txtAs.Text = AAcero
txtpmin.Text = pmin
txtAsmin.Text = AAsmin
txtpbal.Text = pbal
txtpmax.Text = pmax
txtAsmax.Text = AAsmax
tramo
end sub