codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Adding records from a text file  zosimov at 17:14 on Friday, October 17, 2003
 

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.

  Re: Adding records from a text file  Jeff Anderson at 10:32 on Sunday, October 19, 2003
 

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.








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Cadenas.CoCreate.FTI.IMSI.CADCAM.DELCAM.GMI.PLAXIS
•  Cadenas.CoCreate.FTI.IMSI.CADCAM.DELCAM.GMI.PLAXIS
•  Schlumberger.PTC.Siemens.EDS.CATIA.CIMATRON.AUTODESK
•  PDMS.Plate.UGS.CYME.FLOMERICS.Tanner.LINUX.MAC.UNIX
•  Tanner.CrossLight.Elite.Software.Geocentrix.FLOW.3D.PTC.
•  ITTVIS.ENVI.Leica.Erdas.LEAP.SOFTWARE.MapInfo.Nobeltec.
•  Re: Cracked software ftp download 2013
•  Re: Crack Engineering Software
•  Full engineering software


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2013