Data | database ' =================================================================== 
"Read the information from the text file, take a part of it, and insert it into the database ... 
"' Xhony@163.com 
' Version 1.0 
''=================================================================== 
<% 
 
Dim fso,f1 
Const ForReading = 1 
 
Set Fso=createobject ("Scripting.FileSystemObject") 
"Use the FSO object to read the information. 
Set F1=FSO. OpenTextFile ("E:\doit\info2.txt", ForReading) 
' Open the file you want to read 
Dim Conn,rst 
 
Set Conn=server.createobject ("Adodb.connection") 
"Establish a database connection, perform an action 
Set Rst=server.createobject ("Adodb.recordset") 
 
Conn.Open "Driver={microsoft Access Driver (*.mdb)};D bq=" &server.mappath ("Db1.mdb") 
 
Rst.activeconnection=conn 
 
Dim fread 
 
Do as not F1.atendofstream 
"Use do ... loop loop body Insert Data 
Fread=f1.readline 
 
Line=split (Fread, ":::") 
 
Rst.source= "INSERT into Barcode1 (BARCODE1) VALUES (" &trim (line (0)) & ") 
Rst.open 
Loop 
 
F1.close 
Conn.close 
"" All Over 
%>