|
I have several text files generated daily that contains a record set that I want to add to my ms sql database. I have the connection string of:
' Setting variables
Dim con, sql_insert, data_source
data_source = imailspam
sql_insert = "insert into "table"
values" &_ "(getdate(),'server','dynamic')"
' Creating the Connection Object and opening the database
Set con = Server.CreateObject("ADODB.Connection")
con.Open "Provider=SQLOLEDB.1;Data Source=server;Initial Catalog=spam-","user","pass"
' Executing the sql insertion code
con.Execute sql_insert
' Done. Now Close the connection
con.commit
con.Close
Set con = Nothing
***********
problem is how do I get the data from the text file to be inserted dynamically for that day into the database table. Thanks for any help.
|
|
|
If I understand you correctly, you should use the filesystemobject to open the text file and read it into a variable. Let me know if you need more help with that.
|
|
|
|
|
|
|
|