当前位置:开发者网络 >> 技术教程 >> 数据库专栏 >> 其他相关 >> 内容
精彩推荐
分类最新教程
分类热点教程
  
把vfp表中的数据导入指定的excel文件中
作者:未知
日期:2005-04-29
人气:
投稿:(转贴)
来源:未知
字体:
收藏:加入浏览器收藏
以下正文:

 


select cb_zwhz
go top
XLApp = GetObject('F:\temp qlinout.xls','excel.sheet')
XLApp.application.visible=.F.
XLApp.application. Windows("sqlinout.xls").Visible = .T.
XLSheet =XLApp.Sheets['Sheet1']
XLSheet.Cells(1,1).Value = "Month"
XLSheet.Cells(1,2).Value = "ZwCode"
XLSheet.Cells(1,3).Value = "Qty"
XLSheet.Cells(1,4).Value = "Cost"
XLSheet.Cells(1,5).Value = "Money"

i=1
select cb_zwhz
do while not eof ()
  XLSheet.Cells(i+1,1).Value=Month
  XLSheet.Cells(i+1,2).Value=ZwCode
  XLSheet.Cells(i+1,3).Value=Qty
  XLSheet.Cells(i+1,4).Value=Cost
  XLSheet.Cells(i+1,5).Value=Money
  skip
  i=i+1
enddo 
XLApp.Save
XlApp.Close

相关文章: