使用者工具

網站工具


asp:extosql

程式流程圖

Code

1
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<% option explicit %>
<!-- #include file="__function/_zzAlidb.asp"-->
<!-- #include file="__function/excel_db.asp"-->
<%
'測試
 
 
Dim RSex,conn,RS,i,arrytmp,fieli
set RSex=GetExcelRecordset("zzExcel.xls","select * from [custom2$]")
set conn=CreateConn(request.QueryString("__Path")&"/db/news.mdb")
'set RS=rs_create("select * from custom_data",conn,"w")
i=0
arrytmp=array("login","pwd","start_date","end_date","name","g51_id","sn","g52_id","pay_day","idno","man","boss","address","bill_address","tel","fax","phone","mail","g53_id","price","price_lg","price_bd","note","price_in_box","price_in_piece","price_in_lg","price_in_bd","price_out_box","price_out_piece","price_out_lg","price_out_bd","create_datetime","create_user","change_datetime","change_user","ss_date")
do while not RSex.eof
set RS=rs_create("select * from custom_data where custom_id="&RSex("custom_id")&"",conn,"w")
if RS.EOF THEN
RS.addnew
i=i+1
	 for fieli=0 to Ubound(arrytmp)
	'RS("custom_id")=RSex("custom_id")
 
	RS(arrytmp(fieli))=RSex(arrytmp(fieli))
 
	'RS("login")=RSex("login")
	'RS("pwd")=RSex("pwd")
	'RS("start_date")=RSex("start_date")
	'RS("end_date")=RSex("end_date")
	 next
RS.update
end if
RS.close
'response.Write RSex("custom_id")&""&RSex("name")&""&RSex("idno")&"<br/>"
'response.Write RS("custom_id")&""&RS("name")&""&RS("idno")&"<br/>"
RSex.movenext
'RS.movenext
loop
if i=0 then
response.write "ERROR"
else
response.write "新增"&i&"筆"
end if
set RSex=nothing
set RS=nothing
ConnClose(conn)
%>
asp/extosql.txt · 上一次變更: 2013/07/06 01:28 (外部編輯)