-
<%
-
dim fso,f1
-
Const ForReading = 1
-
set fso=createobject("Scripting.FileSystemObject")
-
''使用fso对象读取信息。
-
set f1=fso.OpenTextFile("E:\doit\info2.txt", ForReading)
-
''打开要读取的文件
-
dim conn,rst
-
-
set conn=server.createobject("adodb.connection")
-
''建立数据库连接,执行操作
-
set rst=server.createobject("adodb.recordset")
-
-
conn.open "Driver={Microsoft Access Driver (*.mdb)};DBQ="&Server.mappath("db1.mdb")
-
-
rst.activeconnection=conn
-
-
dim fread
-
-
do while not f1.atEndOfStream
-
''用do... loop循环体插入数据
-
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
-
%>