Skip to content

Archive

Category: Visual Basic

Private Sub Text1_KeyDown (KeyCode As Integer, Shift As Integer)
    Dim ShiftDown, AltDown, CtrlDown, Txt
    ShiftDown = (Shift And vbShiftMask) > 0
    AltDown = (Shift And vbAltMask) > 0
    CtrlDown = (Shift And vbCtrlMask) > 0
    If KeyCode = vbKeyF2 Then   ‘ 키의 조합 상태를 출력합니다.
        If ShiftDown And CtrlDown And AltDown Then
            Txt = “SHIFT+CTRL+ALT+F2.”
        [...]

ByVal :
By Value 의 약자로써,
값에 의한 전달을 지칭합니다.
값만 전달하는 것 뿐이지, 그 값을 함수 내부에서 고친다고해서, 원래의 변수는 변하지 않습니다.
이 경우에 형태로써 Object, Array는 들어갈 수 없습니다.
예문)
Private Sub Form_Load()
Dim b As Integer
b=3
ax b ‘원래의 b값은 그대로 있습니다.
End Sub
Sub ax(ByVal a As Integer)
a=4 ‘이 함수 안에서만 적용 됩니다.
End Sub
ByRef :
By Reference 의 약자로써,
참조에 의한 전달을 지칭합니다.
값도 [...]

Value(0) : sckclosed 소켓이 끊어진 상태
Value(1) : sckopen 소켓이 열린상태
Value(2) : scklistening 소켓이 대기중
Value(3) : sckConnetionPending 접속을 기다립니다
Value(4) : sckResolvingHost 호스트 이름에서 IP를 얻는중
Value(6) : sckConnecting 연결하고 있는 중
Value(7) : sckConnected 연결된 상태
Value(8) : sckclosing 소켓이 끊어지고 있음
Value(9) : sckerror 소켓에 에러가 남

영문윈도우에서 ADO : Selected Collating Sequence Not Supported 오류로
MDB에 접근이 안될때…
MDB의 New database Sort Order 가 Korean 으로 설정되었을 경우
General로 설정후 데이터베이스를 다시 생성해야한다.
 
 
출처 : http://support.microsoft.com/default.aspx?scid=KB;en-us;q202150
 
 
You receive a “Selected Collating Sequence Not Supported” error message in Access 2000
View products that this article applies to.

Article ID
:
202150

Last Review
:
August 6, 2004

Revision
:
1.0

This article was previously published under Q202150

For a [...]

‘Define the required variable for Excel File
Dim mExcel                      As Excel.Application  ’ This is the excel program
Dim mExcelWBk                   As Excel.Workbook     ’ This is the work book
Dim mExcelWS                    As Excel.Worksheet    ’ This is the sheet
Dim ExcelFileName               As String             ’추출Excel 파일명
Set mExcel = CreateObject(”Excel.Application”)
mExcel.Visible = False
Set mExcelWBk = mExcel.Workbooks.Add              ’Add this Workbook to Excel.
Set mExcelWS = mExcelWBk.Worksheets(1)            ’Add this sheet to this Workbook
‘엑셀 셀에 데이타 넣기
mExcelWS.Cells(1, 1) = ”Data”
mExcelWS.Cells.Select
With mExcelWS.Application.Selection.Font
    .Name = ”돋움”
    .Size = 10
    .Strikethrough = False
    .Superscript = False
    .Subscript = False
    .OutlineFont = False
    .Shadow = False
    .Underline = xlUnderlineStyleNone
    .ColorIndex = xlAutomatic
End With
mExcelWS.RANGE(”A1″).Select
‘Ecxel File생성
mExcelWBk.SaveAs ”C:” & ExcelFileName    ’Save ExcelFile
mExcelWBk.Close     ’Close the WorkBook
mExcel.Quit         ’Quit Excel app
Set mExcelWS = Nothing
Set mExcelWBk = Nothing
Set mExcel = Nothing

Dim oConn As New ADODB.Connection
Dim constr As String
    
constr = ”provider=MSDASQL.1″
constr = ”Driver={Microsoft Access Driver (*.mdb)};” & _
               ”Dbq=C:\swip\cbt\controlserver\database\B00001.mdb;” & _
               ”Uid=admin;” & _
               ”Pwd=;”
  
oConn.ConnectionString = constr
oConn.Open

ADO Connection String 입니다.
이 것을 사용하는 예제는 검색해보면 많이 나오니까 한번 사용해 보세요..^^
 
ODBC DSN-Less Connections
ODBC Driver for Access
For Standard Security:
oConn.Open “Driver={Microsoft Access Driver (*.mdb)};” & _
                   “Dbq=c:somepathmydb.mdb;” & _
                   “Uid=admin;” & _
                   “Pwd=;” 
If you are using a Workgroup (System database):
oConn.Open “Driver={Microsoft Access Driver (*.mdb)};” & _
                   “Dbq=c:somepathmydb.mdb;” & _
                   “SystemDB=c:somepathmydb.mdw;”, “myUsername”, “myPassword” 
If want to [...]