PDA

Click to See Complete Forum and Search --> : Updating a Database using c.s.v files


asimrazzaq
Feb 25th, 2001, 04:53 AM
Hello People,

I'm trying to create a online investment portfolio tool

At the moment I have a database with share prices and data on portfolio holdings.

Now one problem I have is updating the share prices. My solution is to downlaod a csv file from another website and try to import this into the database using vbscript, but this is done at night.

I'm just wondering if there is any other way I could update the share prices, may be by getting the data directly from another server or something.

anyone with any ideas, very much appreciated!

Clunietp
Feb 25th, 2001, 10:32 AM
here is some VB/ADO code I have previously written to connect to a CSV text file. This should get you started with what you need to do (assuming you're familiar with databases and VB vs. VBScript)


'Uses ADO 2.1+

Dim cn As Connection
Dim rs As Recordset

Set cn = New Connection
Set rs = New Recordset

'open connection to folder that contains the CSV file
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\;Extended Properties=Text;"

'open the file
rs.Open "select * from test.csv", cn

'we have data
MsgBox rs.Fields(1).Value