Visual Basic

    VB 에서 오라클 DB 조회

    1. 오라클 클라이언트를 설치하고 2. TNS 설정을 해주고. 3. ADODB를 이용해 접속 하면 됩니다. 예제 코드는 아래와 같습니다. [CODE type="visual basic"] VERSION 5.00 Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX" Begin VB.Form Form1 Caption = "정보 조회 v0.1" ClientHeight = 7635 ClientLeft = 60 ClientTop = 345 ClientWidth = 10605 LinkTopic = "Form1" Picture = "Form1.frx":0000 ScaleHeight = 7635 ScaleWidth = 10605 StartUpPo..

    MDI에서 특정 자식창을 하나만 띄우기

    Public Sub OpenDlg() Dim frm As Form ' 존재할 경우 존재하는 폼을 활성화 For Each frm In Forms If TypeOf frm Is frmChild Then frm.SetFocus Exit Sub End If Next frm ' 존재하지 않을 경우 새로 만든다. Set frm = New frmChild frm.Show End Sub

    항상 위 효과 내기

    '항상 위 SetWindowPos Me.hwnd, -1, 0, 0, 0, 0, 3 '항상 위 해제 SetWindowPos Me.hwnd, -2, 0, 0, 0, 0, 3

    폴더 만들기 ( 부모 폴더가 없을경우에는 부모 폴더도 만듬)

    ' 경로를 만든다. Public Function MakeDir(ByVal strpath As String) As Boolean If strpath = "" Then Exit Function strpath = Replace(strpath, "/", "\") If Right(strpath, 1) = "\" Then strpath = Mid(strpath, 0, Len(strpath) - 1) If Dir(strpath, vbDirectory) "" Then MakeDir = True Exit Function End If MakeDir = MakeDir(ExtractDir(strpath)) MkDir (strpath) End Function

    전체 경로를 받아 파일명 또는 폴더명만 얻기

    ' 전체경로명에서 파일이름만 구한다. Public Function ExtractFileName(ByVal strpath As String) As String strpath = StrReverse(strpath) If InStr(strpath, "\") > 0 Then strpath = Left(strpath, InStr(strpath, "\") - 1) End If ExtractFileName = StrReverse(strpath) End Function ' 전체경로명에서 경로명만 구한다. Public Function ExtractDir(ByVal strpath As String) As String Dim n n = Len(ExtractFileName(strpath)) ExtractDir = strpat..