<%
sub insertdata
randomize
k = int(5*rnd)+3
c = ""
for j = 1 to k : c = c + chr(int(26*rnd)+65) : next
r = int(10000*rnd)
sql="insert into tempfile(tmpch,tmpnum,tmpdate)values('"&c&"',"&r&",'"&Now&"')"
connect.execute(sql)
end sub
dim connect, sql, c, r, k
set connect = server.createobject("ADODB.Connection")
connect.open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &_
Server.MapPath("\perlphpasp\db\tempdb.mdb"))
for i = 1 to 6 : insertdata : next
connect.close
set connect = nothing
response.write("Insert 6 records : ok")
%>
จำนวน : 19 บรรทัด