Global It Leader!!



 
 

VB SQLite 유용한 함수

페이지 정보

작성자 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 댓글 0건 조회 6,321회 작성일 13-12-16 00:30

본문

Private Declare Sub sqlite3_open Lib "SQLite3VB.dll" (ByVal FileName As String, ByRef handle As Long)
Private Declare Sub sqlite3_close Lib "SQLite3VB.dll" (ByVal DB_Handle As Long)
Private Declare Function sqlite3_last_insert_rowid Lib "SQLite3VB.dll" (ByVal DB_Handle As Long) As Long
Private Declare Function sqlite3_changes Lib "SQLite3VB.dll" (ByVal DB_Handle As Long) As Long
Private Declare Function sqlite_get_table Lib "SQLite3VB.dll" (ByVal DB_Handle As Long, _
ByVal SQLString As String, ByRef ErrStr As String) As Variant()
Private Declare Function sqlite_libversion Lib "SQLite3VB.dll" () As String ' Now returns a BSTR
Private Declare Function number_of_rows_from_last_call Lib "SQLite3VB.dll" () As Long

Private Function DBQuery(ByVal DBFile As String, ByVal QueryStr As String, ByRef ErrStr As String) As Long
On Error GoTo ERR_TRAP
Dim DB As Long
Dim i As Long
Dim mVar As Variant ' Will hold our results
Dim mV1 As Variant ' Will be used to get each individual result
Dim mErrStr As String
Dim mStr As String
Dim mRowCnt As Long
Dim mCurColumn As String
Dim LI As ListItem
If QueryStr = "" Or DBFile = "" Then Exit Function
sqlite3_open DBFile, DB
If DB > 0 Then
mVar = sqlite_get_table(DB, QueryStr, mErrStr)
If mErrStr <> "" Then
ErrStr = mErrStr
sqlite3_close DB
Exit Function
Else
mRowCnt = number_of_rows_from_last_call
If mRowCnt > 0 Then
For Each mV1 In mVar
mStr = mV1
If i = 0 Then
mCurColumn = mStr
lvResults.ColumnHeaders.Add , mCurColumn, mCurColumn
Else
If lvResults.ColumnHeaders.Count = 1 Then
lvResults.ListItems.Add , , mStr
ElseIf lvResults.ColumnHeaders.Count > 1 Then
Set LI = lvResults.ListItems(i)
LI.SubItems(lvResults.ColumnHeaders.Count - 1) = mStr
End If
End If
i = i + 1
If i > mRowCnt Then
i = 0
End If
Next
End If
End If
sqlite3_close DB
End If
DBQuery = lvResults.ListItems.Count
Exit Function
ERR_TRAP:
ErrStr = Err.Description
End Function

첨부파일

댓글목록

등록된 댓글이 없습니다.

전체 95
게시물 검색
컴퓨터언어 목록
번호 제목 글쓴이 조회 날짜
열람중 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6322 12-16
54 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4449 11-14
53 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 8855 11-05
52 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4623 10-24
51 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 7111 10-24
50 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4661 07-26
49 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4743 03-09
48 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4910 03-09
47 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10842 06-30
46 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6707 06-25
45 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 7468 06-25
44 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 8032 06-25
43 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 13003 06-24
42 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 8538 06-24
41 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9230 06-17
40 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 24953 07-22
39 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9921 07-21
38 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 8410 07-21
37 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 8724 07-21
36 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 8112 07-20