Global It Leader!!



 
 

VB mysql odbc 자동설정 배포파일 만들기

페이지 정보

작성자 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 댓글 0건 조회 6,998회 작성일 12-08-29 02:05

본문

VB + MySQL ODBC 자동설정 배포파일 만들기

몇일동안 어떻게 할까 고민하다가 인스톨팩토리 가지고 놀다가 드디어 성공했습니다.

우선
http://www.mysql.com/downloads/api-myodbc-3.51.html 에서
Windows downloads->Driver DLLs only (release and debug) 를 다운 받고 압축을 푸세요

myodbc3.dll <- 요 파일만 있으면 됩니다.

 

아래 이미지에 없는 부분을 그냥 두셔도 됩니다.












아래.. 연결 소스입니다.

Private rs As ADODB.Recordset
Private cn As ADODB.Connection

'------------------------------------------------------------------------------
'Form_Load
'------------------------------------------------------------------------------
Private Sub Form_Load()
Set cn = New ADODB.Connection

Dim strconnect As String
strconnect = "driver={MySQL ODBC 3.51 Driver};server=아이피입력;uid=아이디입력;pwd=패스워드입력;database=연결할DB명;dsn=데이터소스이름"
cn.ConnectionString = strconnect
cn.Open ConnectionString
cn.CursorLocation = adUseClient

SSTab1.Tab = 0

On Error GoTo 0

Form_Load_Exit:
Exit Sub

Error:
MsgBox Err.Description, vbExclamation, "Error in [Form_Load]"

End Sub
'------------------------------------------------------------------------------
'Function 검색버튼 클릭( 검색 아무거나 해볼께요)
'------------------------------------------------------------------------------
Private Sub cmdFunctionSearch_Click()
Set rs = New ADODB.Recordset
Dim sql As String

sql = "select t1.*,t2.indName from IndustryFunction as t1, Industry as t2 where t1.indIdx=t2.indIdx"

rs.Open sql, cn, adOpenStatic
If rs.EOF Then
lstFunction.ListItems.Clear
MsgBox "검색된 결과가 없습니다.", vbInformation, "검색된 결과가 없습니다."
txtFunctionSearch.Text = ""
Else
Call LoadResultFunction(rs) '<- 검색된 결과를 listView 에 뿌려줍니다.
End If

If Not IsNull(rs) Then
rs.Close
End If

On Error GoTo 0

cmdFunctionSearch_Click_Exit:
Exit Sub

Error:
MsgBox Err.Description, vbExclamation, "Error in [cmdFunctionSearch_Click]"
End Sub
'------------------------------------------------------------------------------
'Form unload
'------------------------------------------------------------------------------
Private Sub Form_Unload(Cancel As Integer)
If Not IsNull(cn) Then
cn.Close
End If
End Sub

[이 게시물은 오원장님에 의해 2013-02-28 16:41:58 오피스팁에서 이동 됨]

댓글목록

등록된 댓글이 없습니다.

전체 95
게시물 검색
컴퓨터언어 목록
번호 제목 글쓴이 조회 날짜
열람중 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6999 08-29
14 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4826 08-29
13 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 5710 08-24
12 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 5147 08-09
11 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6007 08-09
10 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 5575 04-07
9 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 13225 01-07
8 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 7346 12-01
7 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 7476 04-08
6 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9550 04-08
5 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 7909 02-24
4 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10551 07-22
3 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 11907 07-22
2 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10446 07-22
1 VB no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9884 07-22