¾Æ·¡.. ¿¬°á ¼Ò½ºÀÔ´Ï´Ù.
Private rs As ADODB.Recordset Private Ãß 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
Copyright By AccessVision
|