ASP数据导出到Excel

时间:2018-05-21 14:11:06

标签: excel asp-classic

我试图使用Do While Loop将数据从ASP Classic Application导出到Excel表格。在导出期间,错误(我猜 - 损坏的日期)发生在循环内部,因此导出失败并且没有到达应该输入结束标记的点。

<style src="@/assets/css/base.css"> ->ok
<style src="./assets/css/base.css"> ->error

This dependency was not found:
* !!vue-style-loader!css-loader?{"sourceMap":true}!../../node_modules/vue-loader/lib/style-compiler/index?{"vue":true,"id":"data-v-656039f0","scoped":false,"hasInlineConfig":false}!./assets/css/base.css in ./src/components/HelloWorld.vue

To install it, you can run: npm install --save !!vue-style-loader!css-loader?{"sourceMap":true}!../../node_modules/vue-loader/lib/style-compiler/index?{"vue":true,"id":"data-v-656039f0","scoped":false,"hasInlineConfig":false}!./assets/css/base.css

@import '@/assets/css/base.css' ->error
@import './assets/css/base.css' ->error

Module build failed: Error: Failed to find '@/assets/css/base.css'
@ ./node_modules/vue-style-loader!./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-656039f0","scoped":false,"hasInlineConfig":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/HelloWorld.vue 4:14-312 13:3-17:5 14:22-320

结果,我将部分数据导出到文件中。由于缺少结束标记,因此无法打开该文件。有什么方法可以解决这个问题?

1 个答案:

答案 0 :(得分:0)

选项1。修复损坏的数据,以免循环失败。

选项2。 在循环之前有以下内容。这将导致它忽略错误并继续。

on error resume next

然后用

将其恢复正常
on error goto 0

e.g。

//get data from the database into DataContainer
    on error resume next
    Do While Not DataContainer.eof
        sRow = "<Row>" &_
               "<Cell><Data Type=""Number""></Data></Cell>" &_
               "<Cell><Data Type=""String"">" &_ DataContainer("Field2") & "</Data></Cell>" &_
        ... 
               "<Cell><Data Type=""String"">" &_ DataContainer("Field15") & "</Data></Cell>" 
        If Not Err Then
            response.write sRow
            response.flush
        End If
        DataContainer.movenext
    Loop
    on error goto 0
 response.write "</Table>" 
 response.write "</Worksheet>" 
 response.write "</Workbook>"