Sunteți pe pagina 1din 3

Global MydbName As String, MyrcSource As String

Global txtPassword As String


Global PilihEdit As String
Global UmumText1 As String, UmumText2 As String
Global txtCari As String, txtList As String
Global txtPhys As String, txtFeature1 As String
Global txtStructure1 As String, txtDetail1 As String
Global txtFeature2 As String, txtStructure2 As String
Global txtDetail2 As String, txtIdxList As String
Global txtDDStart As String, txtDDFinish As String
Global txtRDStart As String, txtRDFinish As String
Global txtAddresse As String, txtOut As String
Global txtAttnto As String, txtOutIn As String
Global txtTitle As String, txtInOut As String
Global txtGanti As String, dbname As String, txtPath As String

Public Sub SetDatabasePassword(DBFile As String, _


NewPassword$)
On Error Resume Next
Dim db As Database
'Buka file database
Set db = OpenDatabase(DBFile, True)
'Set password baru
db.NewPassword "", NewPassword$
'db.NewPassword "", ""
'Tutup file database
db.Close
End Sub
Public Sub ClearDatabasePassword(DBFile As String, OldPassword$)
On Error Resume Next
Dim db As Database
'Buka file database
Set db = OpenDatabase(DBFile, True, False, ";pwd=" & OldPassword$)
'Hapus password jika berhasil membuka file tsb
db.NewPassword OldPassword$, ""
'Tutup database
db.Close
End Sub

Sub Main()
' txtPassword = Chr(106) & Chr(115) & Chr(48) & Chr(55) & Chr(57) & Chr(53)
' txtPassword = Chr(110) & Chr(97) & Chr(48) & Chr(54) & Chr(57) & Chr(51)
txtPassword = "mfh1411"
On Error Resume Next
' dbname = "\\server\ladms\ladms.mdb"
' dbname = "\\admin\ladms\ladms.mdb"
' dbname = "\\master\ladms\ladms.mdb"
' dbname = "d:\ladms\ladms.mdb"
' dbname = "\\plne03\ladms\ladms.mdb"
dbname = "\\plne05\ladms\ladms.mdb"
' dbname = "c:\ladms\ladms.mdb"
' txtPath = "\\server\ladms\"
' txtPath = "\\admin\ladms\"
' txtPath = "\\master\ladms\"
' txtPath = "d:\ladms\"
' txtPath = "\\plne03\ladms\"
txtPath = "\\plne05\ladms\"
' txtPath = "c:\ladms\"
ResWidth = Screen.Width \ Screen.TwipsPerPixelX
ResHeight = Screen.Height \ Screen.TwipsPerPixelY
ScreenRes = ResWidth & "x" & ResHeight
If ResWidth < 1024 And ResHeight < 768 Then
MsgBox "Resolusi Layar kurang dari 1024x768 " & vbCrLf _
& "Atur Resolusi Layar Terlebih Dahulu", vbCritical
End
End If
' Call ClearDatabasePassword(dbname, "faruq")
Load Form22
Form22.Show

End Sub

Function TextMonth(txtMont$) As String


Select Case txtMont$
Case "01"
tMonth$ = "JANUARY"
Case "02"
tMonth$ = "FEBRUARY"
Case "03"
tMonth$ = "MARCH"
Case "04"
tMonth$ = "APRIL"
Case "05"
tMonth$ = "MAY"
Case "06"
tMonth$ = "JUNE"
Case "07"
tMonth$ = "JULY"
Case "08"
tMonth$ = "AUGUST"
Case "09"
tMonth$ = "SEPTEMBER"
Case "10"
tMonth$ = "OCTOBER"
Case "11"
tMonth$ = "NOVEMBER"
Case "12"
tMonth$ = "DECEMBER"
Case Else
tMonth$ = " "
End Select
TextMonth$ = tMonth$
End Function

Function TextMonth1(txtMont$) As String


Select Case txtMont$
Case "01"
tMonth$ = "January"
Case "02"
tMonth$ = "February"
Case "03"
tMonth$ = "March"
Case "04"
tMonth$ = "April"
Case "05"
tMonth$ = "May"
Case "06"
tMonth$ = "June"
Case "07"
tMonth$ = "July"
Case "08"
tMonth$ = "August"
Case "09"
tMonth$ = "September"
Case "10"
tMonth$ = "October"
Case "11"
tMonth$ = "November"
Case "12"
tMonth$ = "December"
Case Else
tMonth$ = " "
End Select
TextMonth1$ = tMonth$

End Function

S-ar putea să vă placă și