Global It Leader!!



 
 

VB SQLite 유용한 함수

페이지 정보

작성자 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 댓글 0건 조회 6,322회 작성일 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

첨부파일

댓글목록

등록된 댓글이 없습니다.

전체 440
게시물 검색
컴퓨터언어 목록
번호 제목 글쓴이 조회 날짜
260 Mysql no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4391 12-18
259 Javasript no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4325 12-18
258 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4745 12-17
257 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6780 12-17
256 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4643 12-16
255 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4401 12-16
254 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4527 12-16
열람중 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6323 12-16
252 Javasript no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4909 12-09
251 Javasript no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4359 11-18
250 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4450 11-14
249 Mysql no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4502 11-10
248 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 8856 11-05
247 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4624 10-24
246 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 7112 10-24
245 Javasript no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4246 09-29
244 Javasript no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4543 09-19
243 Javasript no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4394 09-19
242 Javasript no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4728 09-06
241 PHP no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4601 08-28