首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

各位前辈帮忙看看小弟我这段代码有错没有?是上传本地数据用的!数据库是ACCESS!谢了啊

2012-03-24 
各位前辈帮忙看看我这段代码有错没有?是上传本地数据用的!数据库是ACCESS!谢了啊!!--includefile ../..

各位前辈帮忙看看我这段代码有错没有?是上传本地数据用的!数据库是ACCESS!谢了啊!
<!--include   file= "../../club/CONN.ASP "   -->
<!--#include   file= "../../club/inc/MD5.ASP "   -->
<!--#include   file= "../../member/db/cnmb.asp "   -->
<!--#include   file= "../../club/inc/CONN.ASP "   -->
<!--include   file= "../../club/chat/conn.asp "   -->
<%cnMbOpen%>
<%
dim   xxlsfile,lxlsfile,action,sfile,conn3,conn2
xxlsfile=request.Form( "backfile ")
lxlsfile=request.Form( "backfile2 ")
action=request.Form( "sj ")

if   action= "xsj "   then
sfile=Server.MapPath( "UploadFiles ")& "\ "&xxlsfile
else  
sfile=Server.MapPath( "UploadFiles2 ")& "\ "&lxlsfile
end   if
if   sfile= " "   then
response.Write( "出错了,情与程序设计人员联系! ")
else
'set   conn=CreateObject( "ADODB.Connection ")
'conn.Open   "Provider=Microsoft.Jet.OLEDB.4.0;Jet   OLEDB:Database   Password=;Data   Source=E:\我的工作目录\IIS\IIS主目录\member\db\fjkhg48ukfjgh84u7jhghfj.mdb "

'set   conn3=CreateObject( "ADODB.Connection ")
'conn3.Open   "Provider=Microsoft.Jet.OLEDB.4.0;Jet   OLEDB:Database   Password=;Data   Source=/club/Data/#DVBBS71.asp "

set   conn2=CreateObject( "ADODB.Connection ")
conn2.Open   "Provider=Microsoft.Jet.OLEDB.4.0;Jet   OLEDB:Database   Password=;Extended   properties=Excel   5.0;Data   Source= "&sfile

if   action= "xsj "   then
sql   =   "SELECT   *   FROM   [Sheet1$] "  
set   rs   =   conn2.execute(sql)
while   not   rs.eof
fkrq=left(rs(7),4)& "- "&mid(rs(7),5,2)& "- "&right(rs(7),2)
jzrq=left(rs(8),4)& "- "&mid(rs(8),5,2)& "- "&right(rs(8),2)

if   rs(3) <> " "then
pwd=rs(3)
else
pwd=0
end   if

sql1   =   "insert   into   member([uid],[username],[sex],[IDcard],[email],[ljxfje],[score],[fxrq],[sxrq],[psd],[add],[tel],[yzbm],[klx],[cs],[lpje])   values( ' "&   fixsql(rs(0))   & " ', ' "&   fixsql(rs(1))   & " ', ' "&   fixsql(rs(2))   & " ', ' "&   fixsql(rs(3))   & " ', ' "&   fixsql(rs(4))   & " ', ' "&   fixsql(rs(5))   & " ', ' "&   fixsql(rs(6))   & " ', ' "&   cdate(fixsql(fkrq))& " ', ' "&   cdate(fixsql(jzrq))   & " ', ' "&   fixsql(md5(pwd,16))   & " ', ' "&   fixsql(rs(9))   & " ', ' "&   fixsql(rs(10))   & " ', ' "&   fixsql(rs(11))   & " ', ' "&   fixsql(rs(12))   & " ', ' "&   fixsql(rs(13))   & " ', ' "&   fixsql(rs(14))   & " ') "
 
cnMb.execute(sql1)
 
if   rs(2)= "F "   then  
sex=1  
else  
sex=0  
end   if
'sql2   =   "insert   into   Dv_User([UserName],[UserPassword],[UserEmail],[UserSex],[UserFace],[UserWidth],[UserHeight],[UserIM],[UserClass],[UserWealth],[UserEP],[usercp],[userfav],[Userinfo],[UserSetting],[TitlePic],[UserMsg],[UserToday],[UserGroupID],[UserMoney],[UserTicket])   values( ' "&   fixsql(rs(0))   & " ', ' "&   fixsql(md5(pwd,16))   & " ', ' "&   fixsql(rs(4))   & " ', ' "&   fixsql(sex)   & " ', 'Images/userface/image1.gif ',100,100, '|||||||||||||||||| ', '新手上路 ',100,60,30, '陌生人,我的好友,黑名单 ', '|||||||||||||||||||||||||||||||||||||||||| ', '1|||0|||0 ', 'level0.gif ', '1||12||VIP社区 ', '0|0|0|0|0 ',9,0,0) "


'   connbbs.execute(sql2)
 
  'sql3   =   "insert   into   userinfo([userid],[password],[usersex],[regtime],[grade])   values( ' "&   fixsql(rs(0))   & " ', ' "&   fixsql(rs(3))   & " ', ' "&   fixsql(   if   rs(2)= "F "   then   帅哥   else   靓妹   end   if   )   & " ', ' "&now()& " ',1) "
  'conn.execute(sql3)
  rs.movenext
wend
%>
<table   width= "193 "   align= "center ">
<tr>
<td   width= "144 "> 新数据导入成功! </td>
<td   width= "37 "   height= "20 "   > <button   class= "button "   onClick= "window.history.go(-1) "> 返回 </button> </td>

</tr>
</table>
<%
else
sqll   =   "SELECT   *   FROM   [Sheet1$] "  
set   rsl   =   conn2.execute(sqll)
while   not   rsl.eof
fkrq=left(rsl(7),4)& "- "&mid(rsl(7),5,2)& "- "&right(rsl(7),2)
jzrq=left(rsl(8),4)& "- "&mid(rsl(8),5,2)& "- "&right(rsl(8),2)

  sqll2   =   "Update   memberSet   [ljxfje]= ' "&fixsql(rsl(5))& " ',[score]= ' "&fixsql(rsl(6))& " '   where   uid= ' "&fixsql(rsl(0))& " ' "
  cnMb.execute(sqll2)
 
  rsl.movenext
wend
%>
<table   width= "193 "   align= "center ">
<tr>
<td   width= "144 "> 老数据更新成功! </td>
<td   width= "37 "   height= "20 "   > <button   class= "button "   onClick= "window.history.go(-1) "> 返回 </button> </td>

</tr>
</table>

<%
end   if
cnMboff
set   conn   =   nothing
conn2.close
set   conn2   =   nothing

function   fixsql(str)
  dim   newstr
  newstr   =   str
  if   isnull(newstr)   then
    newstr   =   " "
  else
    newstr   =   replace(newstr, " ' ", " ' ' ")
  end   if
  fixsql   =   newstr
end   function
end   if
%>


[解决办法]
Source=E:\我的工作目录\IIS\IIS主目录\member\db\fjkhg48ukfjgh84u7jhghfj.mdb "
地址不对

热点排行