ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] §Ú¦³¤@­ÓEXCEL ³sµ²¸ê®Æ®wªº°ÝÃD­nµo°Ý

[µo°Ý] §Ú¦³¤@­ÓEXCEL ³sµ²¸ê®Æ®wªº°ÝÃD­nµo°Ý

¥»©«³Ì«á¥Ñ cp914682 ©ó 2023-9-1 20:49 ½s¿è

§Ú¦A¥ÎEXCEL¬d¸ßACCESS¸Ì­±ªº¸ê®Æ  §Ú­n§ä¬Û¦üªº¸ê®Æ §Ú¦³¥Î¹L *¤]¥Î¹L% ¤U¥h´M§ä
¦ý¬O¤£ºÞ«ç»ò¬d³£¬OªÅ¥Õ,µM«á·Ó­ì¥»ªºselect * from ¸ê®Æ where±ø¥ó like '" & Trim(UF1.TB2.Text) & "'")  ³o¼Ë¬d±o¥X¨Ó
µ{¦¡½X¦p¤U
-------------------------------------------------------------------------------------------- ¤À³Î½u
Application.ScreenUpdating = False

Sheets("¸ê®Æ").Range("A2:CE" & r).ClearContents
UF1.LBox1.Clear
'«Å§iª«¥ó
Dim mycon As New ADODB.Connection
Dim myrs As New ADODB.Recordset
If UF1.TB2.Text = "" Then

mycon.Open "provider=microsoft.jet.oledb.4.0;" & "data source=" & ThisWorkbook.Path & "¸ê®Æ®w.mdb;"

Set myrs = mycon.Execute("select * from ¸ê®Æ where ±ø¥ó '%" & Trim(UF1.TB1.Text) & "%'")

Sheets("¸ê®Æ").Range("a2").CopyFromRecordset myrs

myrs.Close
mycon.Close

Set myrs = Nothing
Set mycon = Nothing

r=sheets("¸ê®Æ").range("b1").end (xldown).row

For I = 2 To r
If UF1.TB1.Text = Sheets("¸ê®Æ").Cells(I, 2) Then

    UF1.LBox1.AddItem Trim(Sheets("¸ê®Æ").Cells(I, 2)) & " " & Trim(Sheets("¸ê®Æ").Cells(I, 3)) & " " & Format(Trim(Sheets("¸ê®Æ").Cells(I, 4)), "e/m/dD") & " " & Trim(Sheets("¸ê®Æ").Cells(I, 10)) & " " & Trim(Sheets("¸ê®Æ").Cells(I, 11))
  End If
Next I
End If
If UF1.TB1.Text = "" Then

mycon.Open "provider=microsoft.jet.oledb.4.0;" & "data source=" & ThisWorkbook.Path & "\¡ÓÈû¥óªí.mdb;"

Set myrs = mycon.Execute("select * from ¸ê®Æ where±ø¥ó like '%" & Trim(UF1.TB2.Text) & "%'")

Sheets("¸¸ê®Æ").Range("a2").CopyFromRecordset myrs

myrs.Close
mycon.Close

Set myrs = Nothing
Set mycon = Nothing
r = Sheets("¸ê®Æ").Range("B1").End(xlDown).Row


For I = 2 To r
If UF1.TB2.Text = Sheets("¸ê®Æ").Cells(I, 10) Then

    UF1.LBox1.AddItem Trim(Sheets("¸ê®Æ").Cells(I, 2)) & " " & Trim(Sheets("¸ê®Æ").Cells(I, 3)) & " " & Format(Trim(Sheets("¸ê®Æ").Cells(I, 4)), "e/m/dD") & " " & Trim(Sheets("¸ê®Æ").Cells(I, 10)) & " " & Trim(Sheets("¸ê®Æ").Cells(I, 11))
  End If
Next I
End If


Application.ScreenUpdating = True

¦^´_ 1# cp914682


    ¥H¸Ñ¨M

TOP

        ÀR«ä¦Û¦b : ¥Í®ð¡A´N¬O®³§O¤Hªº¹L¿ù¨ÓÃg»@¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD