- ©«¤l
- 361
- ¥DÃD
- 57
- ºëµØ
- 0
- ¿n¤À
- 426
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- 2003,2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-13
- ³Ì«áµn¿ý
- 2022-12-8
|
¦^´_ 1# junkwei
sql»yªk§Y¥i§¹¦¨
stock.mdb=>´«¦¨§Aªº¸ê®Æ®w¦WºÙ
¬Y¬Yªí=>´«¦¨§A¸ê®Æ®w¤¤ªº¸ê®Æªí¦WºÙ
¥H¤W¬Omdb»yªk¡A·s¸ê®Æ®w½Ð¦Û¦æ·j´M´À´«- Sub ex()
- Worksheets("1").Activate
- Set cn = CreateObject("adodb.connection")
- cn.Open ("Driver={Microsoft Access Driver (*.mdb)};dbq=" & ThisWorkbook.Path & "\stock.mdb")
- Set rs = cn.Execute("select ¯Z¯Å,max(¦~¬ö) as ³Ì¤j¦~¬ö,min(¦~¯Å) as ³Ì¤p¦~¬ö from ¬Y¬Yªí group by ¯Z¯Å")
- w = 1
- For Each tt In rs.Fields 'Åã¥Üªí³æ¦WºÙ
- Cells(w) = tt.Name
- w = w + 1
- Next
- Cells(2, 1).CopyFromRecordset (rs)'¥s¥X¸ê®Æ
- cn.Close
- Set cn = Nothing
- Set rs = Nothing
-
- End Sub
½Æ»s¥N½X |
|