½Ð±Ð¦³ÃöADODB.STREAM©MMicrosoft.XMLHTTPªº¥Îªk
- ©«¤l
- 79
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 193
- ÂI¦W
- 0
- §@·~¨t²Î
- Winwos 7 64 bits
- ³nÅ骩¥»
- Excel 2003/2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- TAIPEI
- µù¥U®É¶¡
- 2010-8-25
- ³Ì«áµn¿ý
- 2019-9-20
|
#10 ªº¼gªk¡A¥u¯à¬Ù¤@Ó¨BÆJ...
Ū¨ú¸ê®Æ > Àx¦s¦¨CSV > (¥i¬Ù²¤)Ū¨úCSV(¥i¬Ù²¤) > CSVª½±µ¼g¤JACCESS > §R°£CSVªº¹Lµ{[code] |
|
diabo
|
|
|
|
|
- ©«¤l
- 79
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 193
- ÂI¦W
- 0
- §@·~¨t²Î
- Winwos 7 64 bits
- ³nÅ骩¥»
- Excel 2003/2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- TAIPEI
- µù¥U®É¶¡
- 2010-8-25
- ³Ì«áµn¿ý
- 2019-9-20
|
§¹¾ãµ{¦¡½X....- Sub ±NCSVÀɸê®Æ¼g¤JACCESS()
- Dim cn As ADODB.Connection
-
- '«Ø¥ßADODB Connectionª«¥óÅܼÆ
- Set cn = New ADODB.Connection
-
- TARGET_DB = "TaiwanDB.mdb"
- tbl = "PRICE_Daily"
- ªÑ²¼¥N¸¹ = "1101"
- theCsvFolder = ThisWorkbook.Path
-
- '«Ø¥ßACCESS(*.mdb)³sµ²
- cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
- "Data Source=" & ThisWorkbook.Path & "\" & TARGET_DB & ";" & _
- "Persist Security Info=False"
-
- strFields = "[Date],[Open],[High],[Low],[Close],[Volume],[Adj Close] as [AdjClose]"
- strSQL = "INSERT INTO [" & tbl & "] SELECT " & ªÑ²¼¥N¸¹ & " as [StockID]," & strFields & " FROM [Text;Database=" & theCsvFolder & "].[" & ªÑ²¼¥N¸¹ & "#CSV]"
- '°õ¦æSQL command
- cn.Execute strSQL
-
- 'Ãö³¬ADODB connection
- cn.Close
-
- '²M°£¦û¥Î°O¾ÐÅé
- Set cn = Nothing
- End Sub
½Æ»s¥N½X |
|
diabo
|
|
|
|
|
- ©«¤l
- 83
- ¥DÃD
- 17
- ºëµØ
- 0
- ¿n¤À
- 105
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- XP
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-12-28
- ³Ì«áµn¿ý
- 2018-8-8
|
³oÓ¤èªk¦n¹³¤£¿ù¡A«Ý§Ú¦^®a§ï¦¨³oÓ¸Õ¸Õ¡AÁÂÁ |
|
|
|
|
|
|
- ©«¤l
- 83
- ¥DÃD
- 17
- ºëµØ
- 0
- ¿n¤À
- 105
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- XP
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-12-28
- ³Ì«áµn¿ý
- 2018-8-8
|
¦^´_ ¤p«L«È
§A¤w¦³¿n¤À44¤À ª©³W: Àɮתþ¥óµ¥¯Å¤¤¾Ç¥Í¡]¿n¤À50¡^¥H¤W¤~¯à¤U¸ü
¥[ªo ¥[ªo!
GBKEE µoªí©ó 2012-8-31 10:24
²×©ó¦¨¬°¤¤¾Ç¥Í¤F¡A¥i¥H¸üªþ¥ó¤F
¤Ó§Q®`¤F¡Aì¨Ó¥i¥H³o¼Ë²¤Æªº¡AÁÂÁ¡I¤º®e¤Ó¦h¡AnÂI®É¶¡®ø¤Æ
¦ý¥i¥H¦h¤F¸Ñ¤@¤U¡A¥ÎDAO ©MADODB¦b°õ¦æ®Ä²v¤W¦³¨S¦³¤À§O¡H
¦]¬°DAO¤£¥Î¹³ADODBn¼gprovider=?????¡A®e©ö°O¦í¡C
¥t¥~¡A§Ú¬Ý¨ì¡u¸ê®Æ¾É¤J¸ê®Æ®w()¡v¤¤¡A§A¬O¥ÎFOR LOOP+.AddNew +.UPDATEªº¤èªk¼g¤J¸ê®Æ¡A³oÓ©M¥ÎSQL COMMANDªºINSERT¡A¦b°õ¦æ³t«×¤W¦³¨S¦³¤À§O¡HÁÂÁ |
|
|
|
|
|
|
- ©«¤l
- 83
- ¥DÃD
- 17
- ºëµØ
- 0
- ¿n¤À
- 105
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- XP
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-12-28
- ³Ì«áµn¿ý
- 2018-8-8
|
¦^´_ ¤p«L«È
¸Õ¸Õ¬Ý
GBKEE µoªí©ó 2012-8-30 16:21
§Úèè¸Õ¤ñ¸û¥Î.ADDNEW©M.UPDATE©MSQL INSERT ³t«×¤ñ¸û¡A§Úµo²{¥ÎSQL INSERT¤ñ«eªÌ§Ö«Ü¦h- Set wb = Workbooks.Open(myUrl)
- With myRS
- For Each a In ActiveSheet.Range([A2], [A2].End(xlDown))
- .AddNew '²K¥[¦UÓÄæ¦ìªº¸ê®Æ
- For i = 1 To .Fields.Count - 1
- .Fields(0) = shareNo
- .Fields(i) = a(1, i)
- Next i
- .Update '§ó·s¸ê®Æªí
- Next
- End With
½Æ»s¥N½X ©Ò¥H§Ú§Æ±æ¥ÎSQL§@¸ê®Æ¼g¤J¡A¦ý½Ð°Ý³o¥y¦p¦ó§ï¼g¦¨¥Î wb ©Îactivebook§@DATABASE©O¡H- "insert into Price select * from (select " & shareNo & " as Share, Date, Open, High, Low, Close, Volume as Vol, [Adj Close] as AClose from [Excel 8.0;hdr=yes;imex=1;Database=" & wb & "].[table$A1:G" & r & "])"
½Æ»s¥N½X ÁÂÁ«ü±Ð |
|
|
|
|
|
|