Monday 15 April 2013

sql - How to copy data from binary CSV file to local Access Database without saving file on computer? -



sql - How to copy data from binary CSV file to local Access Database without saving file on computer? -

i'm new adodb objects. not sure if possible should possible, have medium-sized csv file automatically download url , upload selected local access database.

i can store csv info in adodb.stream object, how proceed upload local access database, create new table , insert info , delimit data?

my code far

dim httpreq xmlhttp60: set httpreq = new xmlhttp60 dim adobstream adodb.stream: set adobstream = new adodb.stream temp = http://ichart.finance.yahoo.com/table.csv?s=alfa.st&a=4&b=24&c=2010&d=9&e=27&f=2013&g=d&ignore=.csv` httpreq.open "get", temp, false httpreq.send until httpreq.readystate = 4 doevents loop dim splitticker() string: splitticker = split(stock, ".") ' splits ticker name dim xpath string: xpath = "c:\**path***" & splitticker(0) & date & ".csv" ' import straight access database delimits , adds primary keys info ' no need save file on computer in case adobstream .open .type = adtypebinary .write httpreq.responsebody .savetofile (xpath) ' create error handling specified c:\ generates error .close end set httpreq = nil set adobstream = nil

sql vba csv access-vba

No comments:

Post a Comment