| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> asp >> asp jiang shu ju dao ru excel hou , zhong wen chu xian luan ma ?? zen me jie jue

asp jiang shu ju dao ru excel hou , zhong wen chu xian luan ma ?? zen me jie jue

2008-08-07 07:35:05 编辑來源:互联网 评论
 
 
 
本文为【asp将数据导入excel后,中文出现乱码??怎么解决】的拼音翻译版
  wen :asp jiang shu ju dao ru excel hou , zhong wen chu xian luan ma ?? zen me jie jue
  <!--#include file="function/connect.asp" -->
  <!--#include file="function/function.asp" -->
  <%
  Response.Charset = "UTF-8"
  ' qian mian bao han de wen jian shi he lai lian jie dao shu ju ku , ni yao xiu gai zhe ge wen jian yi lian jie dao bu tong de ku
  
  sql1="select * from apply " ' zhe li shi yao shu chu EXCEL de cha xun yu ju , ru "SESECT * FORM CAI WHERE xing bie =' nv '"
  filename="excel4.xls" ' yao shu chu de EXCEL wen jian de wen jian ming , ni zhi yao gai yi shang liang ju jiu xing le , qi ta de dou bu yao gai .
  
  call toexcel(FILENAME,sql1)
  set conn=nothing
  
  function ReadText(FileName) ' zhe shi yi ge yong yu du chu wen jian de han shu
   'response.write server.MapPath(FileName)
   'response.end
  set adf=server.CreateObject("Adodb.Stream")
  with adf
  .Type=2
  .LineSeparator=10
  .Open
  .LoadFromFile (server.MapPath(FileName))
  .Charset="GB2312"
  .Position=2
  ReadText=.ReadText
  .Cancel()
  .Close()
  end with
  set ads=nothing
  end function
  
  sub SaveText(FileName,Data) ' zhe shi yi ge yong yu xie wen jian de han shu
  set fs= createobject("scripting.filesystemobject")
   set ts=fs.createtextfile(server.MapPath(FileName),true)
   ts.writeline(data)
   ts.close
   set ts=nothing
   set fs=nothing
  end sub
  
  sub toexcel(filename,sql) ' zhe shi yi ge gen ju SQL yu ju he FILENAME sheng cheng EXCEL wen jian
   Set rs=Server.CreateObject("ADODB.RecordSet")
   'Response.Write sql
   'response.end
   rs.Open sql,objconn,1,1
   TOEXCELLR="<table width='100%'><tr >"
   set myfield=rs.fields
   dim fieldname(50)
   for i=0 to myfield.count-1
   toexcellr=toexcellr&"<td class=xl24>"&MYFIELD(I).NAME&"</td>"
   fieldname(i)=myfield(i).name
   if myfield(i).type=135 then datename=datename&myfield(i).name&","
   next
   toexcellr=toexcellr&"</tr>"
   do while not rs.eof
   toexcellr=toexcellr&"<tr>"
   for i=0 to myfield.count-1
   if instr(datename,fieldname(i)&",")<>0 then
   if not isnull(rs(fieldname(i))) then
   TOEXCELLR=TOEXCELLR&"<td class=xl25 ><p align='left'>"&formatdatetime(rs(fieldname(i)),2)&"</p></td>"
   else
   TOEXCELLR=TOEXCELLR&"<td class=xl25 ><p align='left'></p></td>"
   end if
   else
   TOEXCELLR=TOEXCELLR&"<td class=xl24 >"&rs(fieldname(i))&"</td>"
   end if
   next
   toexcellr=toexcellr&"</tr>"
   rs.movenext
   loop
   rs.close
   toexcellr=toexcellr&"</table>"
   tou=readtext("tou.txt")
   di=readtext("di.txt")
   toexcellr=tou&toexcellr&di
   call savetext(filename,toexcellr)
  end sub
  %>
  <html>
  <head>
  <meta http-equiv="refresh" content="3;URL=<%=filename%>">
  <meta http-equiv="Content-Language" content="en-us">
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title> zheng zai sheng cheng EXCEL wen jian </title>
  </head>
  <BODY>
   zheng zai sheng cheng EXCEL wen jian ....
  </BODY>
  </HTML>
  da :
  EXEC master..xp_cmdshell 'bcp "SELECT * FROM ku ming .dbo.apply where xing bie = nv " queryout "excel4.xls" -c -q -S" fu wu qi ming " -U" yong hu ming " -P" mi ma "'
  
   wo yong zhe zhong fang fa dao chu dao excel mei you chu xian luan ma , ni shi xia ba ,sql shu ju ku【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
wen :asp jiang shu ju dao ru excel hou , zhong wen chu xian luan ma ?? zen me jie jue <!--#include file="function/connect.asp" --> <!--#include file="function/function.asp" --> <% Response.Charset = "UTF-8" ' qian mian bao han de wen jian shi he lai lian jie dao shu ju ku , ni yao xiu gai zhe ge wen jian yi lian jie dao bu tong de ku sql1="select * from apply " ' zhe li shi yao shu chu EXCEL de cha xun yu ju , ru "SESECT * FORM CAI WHERE xing bie =' nv '" filename="excel4.xls" ' yao shu chu de EXCEL wen jian de wen jian ming , ni zhi yao gai yi shang liang ju jiu xing le , qi ta de dou bu yao gai . call toexcel(FILENAME,sql1) set conn=nothing function ReadText(FileName) ' zhe shi yi ge yong yu du chu wen jian de han shu 'response.write server.MapPath(FileName) 'response.end set adf=server.CreateObject("Adodb.Stream") with adf .Type=2 .LineSeparator=10 .Open .LoadFromFile (server.MapPath(FileName)) .Charset="GB2312" .Position=2 ReadText=.ReadText .Cancel() .Close() end with set ads=nothing end function sub SaveText(FileName,Data) ' zhe shi yi ge yong yu xie wen jian de han shu set fs= createobject("scripting.filesystemobject") set ts=fs.createtextfile(server.MapPath(FileName),true) ts.writeline(data) ts.close set ts=nothing set fs=nothing end sub sub toexcel(filename,sql) ' zhe shi yi ge gen ju SQL yu ju he FILENAME sheng cheng EXCEL wen jian Set rs=Server.CreateObject("ADODB.RecordSet") 'Response.Write sql 'response.end rs.Open sql,objconn,1,1 TOEXCELLR="<table width='100%'><tr >" set myfield=rs.fields dim fieldname(50) for i=0 to myfield.count-1 toexcellr=toexcellr&"<td class=xl24>"&MYFIELD(I).NAME&"</td>" fieldname(i)=myfield(i).name if myfield(i).type=135 then datename=datename&myfield(i).name&"," next toexcellr=toexcellr&"</tr>" do while not rs.eof toexcellr=toexcellr&"<tr>" for i=0 to myfield.count-1 if instr(datename,fieldname(i)&",")<>0 then if not isnull(rs(fieldname(i))) then TOEXCELLR=TOEXCELLR&"<td class=xl25 ><p align='left'>"&formatdatetime(rs(fieldname(i)),2)&"</p></td>" else TOEXCELLR=TOEXCELLR&"<td class=xl25 ><p align='left'> </p></td>" end if else TOEXCELLR=TOEXCELLR&"<td class=xl24 >"&rs(fieldname(i))&"</td>" end if next toexcellr=toexcellr&"</tr>" rs.movenext loop rs.close toexcellr=toexcellr&"</table>" tou=readtext("tou.txt") di=readtext("di.txt") toexcellr=tou&toexcellr&di call savetext(filename,toexcellr) end sub %> <html> <head> <meta http-equiv="refresh" content="3;URL=<%=filename%>"> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title> zheng zai sheng cheng EXCEL wen jian </title> </head> <BODY> zheng zai sheng cheng EXCEL wen jian .... </BODY> </HTML> da : EXEC master..xp_cmdshell 'bcp "SELECT * FROM ku ming .dbo.apply where xing bie = nv " queryout "excel4.xls" -c -q -S" fu wu qi ming " -U" yong hu ming " -P" mi ma "' wo yong zhe zhong fang fa dao chu dao excel mei you chu xian luan ma , ni shi xia ba ,sql shu ju ku
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
华丽的模特拍摄(8)
华丽的模特拍摄(7)
华丽的模特拍摄(6)
华丽的模特拍摄(5)
八里沟
朝阳宫
天下峨眉 云上金顶
老家(四)
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有