Pada sub main program, untuk lengkapnya silahkan lihat di baha ini
Public Sub Main()
On Error Resume Next
'get connection info
Dim Server, Userid, Password, Database As String
Dim dwLCID As Long
Dim Maunyakita As String
SetinganAsliDiKomputerUser = GetCurrentDateFormat
Maunyakita = "dd/MM/yyyy"
dwLCID = GetSystemDefaultLCID()
iniFile = Trim(Command())
If iniFile = "" Then iniFile = "HRD.ini"
10:
Server = GetIni("Connect", "Server")
If Server = "" Then
' frmConnect.Show vbModal
GoTo 10
End If
Userid = GetIni("Connect", "Userid")
Password = LCase(Decrypt(GetIni("Connect", "Password")))
Database = GetIni("Connect", "Database")
AttcDir = GetIni("Attachment", "Folder")
TempDir = Environ("TEMP")
ConnectS = "Provider=SQLOLEDB.1;" _
& "Persist Security Info=False;" _
& "User ID=" & Userid & ";" _
& "Password=" & Password & ";" _
& "Initial Catalog=" & Database & ";" _
& "Data Source=" & Server
ConnectRpt = "dsn=" & Server & ";dsq=" & Database & ";uid=" & Userid & ";pwd=" & Password & ";"
DB.CursorLocation = adUseClient
DB.Open ConnectS
'datSQL.conn.ConnectionString = ConnectS
If Err.Number <> 0 Then
frmConnect.Show vbModal
GoTo 10
End If
On Error GoTo LocalErr
frmLogin.Show vbModal
If frmLogin.Succeeded Then
frmMDIMain.Show
End If
Unload frmLogin
Call Regset
Exit Sub
LocalErr:
ShowError "Connection Fail !"
End
End Sub
Senin, 31 Desember 2007
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar