Hello, I have an access database on host server.
I ftp a new csv file to external folder on host server.
I need a program that they can put in a scheduler to pull the csv file into the database and replace my products table.
I have been trying to do it with vbs but cannot get it to work on my local machine. Here is code. Is this concept even possible?
' VB Script Document
Option Explicit
dim conn
dim strConnect
dim Inputtable
dim Importspecname
dim Pathtofile
IMPORTSPECNAME = " "
Inputtable = "products"
PATHTOFILE = "c:\Inetpub\wwwroot\newtables\mycsv.csv"
Set conn = CreateObject("ADODB.Connection")
' Connect to the database
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\wwwroot\data\mydatabase.mdb"
conn.Open strConnect
Function ImportFile()
DoCmd.TransferText acImportDelim, IMPORTSPECNAME, INPUTTABLE, PATHTOFILE, True, ""
End Function