Results 1 to 2 of 2

Thread: Updating a Database using c.s.v files

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2001
    Location
    UK
    Posts
    5

    Unhappy

    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!

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    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)

    Code:
    '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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width