- ©«¤l
- 518
- ¥DÃD
- 54
- ºëµØ
- 0
- ¿n¤À
- 594
- ÂI¦W
- 243
- §@·~¨t²Î
- win 10
- ³nÅ骩¥»
- []
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-3-19
- ³Ì«áµn¿ý
- 2024-11-4
|
¦^´_ 7# Baracuda
¯ÂÄÝ°Q½×¤ÎÓ¤H¬Ýªk
VBA ADO SQL ¦n¹³¨Ã¤£¤ä´©ÅܼƹBºâ¡A
UDF¤]¥u¬O¦bµ²ªGÄæ¦ì©ñ¤Jpºâ¦¡¦Ó¤£¬OADO·|ª½±µpºâ
³oÓÃD¥Ø¡AÓ¤Hªº¬Ýªk¬OADOªº¤ä´©¯à¤O°ÝÃD¦Ó¤£¬O UDF ¸Ì¦³´XӰѼÆ
¥DÄæ¦ì¤]¤@¼Ë¤£¯à¥ÎÅܼÆpºâ¡G
ÀH·NÁ|¨Ò "®Ö©w¥»Á~"
Const aa=2
¥i¥Hpºâ¡F ®Ö©w¥»Á~ * ª½±µ±`¼Æ 2
lcCommandText = "SELECT §Ç¸¹, ©m¦W, ®Ö©w¥»Á~ * 2 as bb, ®Ö©wÁZ®Ä , Á~¸êÁ`ÃB , ³Ò«OÁ~¸ê , ³Ò°hÁ~¸ê , °·«OÁ~¸ê, " & _
" ³Ò°h , ¾¨a, ´¶³q¨Æ¬G, ´N·~«OÀI, ¤u¸ê¹ÔÀv, ¥þ¥Á°·«O, ¥þ¥Á°·«OÂÂ, " & _
" '=Multiply_2_No_Round_Down_4_Up_5(' + trim(str(³Ò°h)) + ',' + trim(str(0.1)) + ')' as ³Ò°hÓ¤H " & _
"FROM " & "[" & Input_Sht & "$" & "A1:P32]"
¥i¥Hpºâ¡F ®Ö©w¥»Á~ * " & aa & " ¡AÅܼƤw¦b¦¨¥ß lcCommandText ¦r¦ê®ÉÂà¤Æ¤F aa ¬° 2¡A2 ¬O±`¼Æ¤£¬OÅܼÆ
lcCommandText = "SELECT §Ç¸¹, ©m¦W, ®Ö©w¥»Á~ * " & aa & " as bb, ®Ö©wÁZ®Ä , Á~¸êÁ`ÃB , ³Ò«OÁ~¸ê , ³Ò°hÁ~¸ê , °·«OÁ~¸ê, " & _
" ³Ò°h , ¾¨a, ´¶³q¨Æ¬G, ´N·~«OÀI, ¤u¸ê¹ÔÀv, ¥þ¥Á°·«O, ¥þ¥Á°·«OÂÂ, " & _
" '=Multiply_2_No_Round_Down_4_Up_5(' + trim(str(³Ò°h)) + ',' + trim(str(0.1)) + ')' as ³Ò°hÓ¤H " & _
"FROM " & "[" & Input_Sht & "$" & "A1:P32]"
¤£·|pºâ¡F ®Ö©w¥»Á~ * aa ªºÅÜ¼Æ aa ¬O lcCommandText ¦r¦êªº¤@³¡¤À¡A ADO¨S¤ä´©¦r¦ê¤ºªºÅܼÆ
lcCommandText = "SELECT §Ç¸¹, ©m¦W, ®Ö©w¥»Á~ * aa as bb, ®Ö©wÁZ®Ä , Á~¸êÁ`ÃB , ³Ò«OÁ~¸ê , ³Ò°hÁ~¸ê , °·«OÁ~¸ê, " & _
" ³Ò°h , ¾¨a, ´¶³q¨Æ¬G, ´N·~«OÀI, ¤u¸ê¹ÔÀv, ¥þ¥Á°·«O, ¥þ¥Á°·«OÂÂ, " & _
" '=Multiply_2_No_Round_Down_4_Up_5(' + trim(str(³Ò°h)) + ',' + trim(str(0.1)) + ')' as ³Ò°hÓ¤H " & _
"FROM " & "[" & Input_Sht & "$" & "A1:P32]" |
|