# DB query to Excel script no longer works in Ignition 8

**URL:** <https://forum.inductiveautomation.com/t/db-query-to-excel-script-no-longer-works-in-ignition-8/45603>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [April 14, 2021, 6:22pm UTC](https://forum.inductiveautomation.com/t/db-query-to-excel-script-no-longer-works-in-ignition-8/45603 "2021-04-14T18:22:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbeauregard66](https://avatars.discourse-cdn.com/v4/letter/s/ecd19e/32.png) [@sbeauregard66](https://forum.inductiveautomation.com/u/sbeauregard66)\
**Post date:** [April 14, 2021, 6:22pm UTC](https://forum.inductiveautomation.com/t/db-query-to-excel-script-no-longer-works-in-ignition-8/45603/1 "2021-04-14T18:22:54Z")

</div>

I have a number of scripts which covert db queries to excel an email them out.  
These no longer work ignition 8. I have fixed 2 things so far I’m stuck on the 3rd.  
Here is an example of one of them.

I have replaced the old system.dataset.dataSetToExcel with the new system.dataset.toExcel  
I have now included the database name in the system.db.runQuery, which I didn’t have to do before.

But now I am getting this error:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/2/521efec9e119ae3daeed495c7be3f9b073841085.png)

Here is the script: (sorry for small size, only way I could capture all)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/f/5f0cba3679bfbbfeaff2d6d109e184f24c359085.png)

Thanks

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 14, 2021, 6:24pm UTC](https://forum.inductiveautomation.com/t/db-query-to-excel-script-no-longer-works-in-ignition-8/45603/2 "2021-04-14T18:24:51Z")

</div>

`system.dataset.toExcel` is already returning a `byte[]`, don’t need to call `encode` on it as if it were a string that you needed bytes for.

---

<div class="post-metadata">

**Author:** ![sbeauregard66](https://avatars.discourse-cdn.com/v4/letter/s/ecd19e/32.png) [@sbeauregard66](https://forum.inductiveautomation.com/u/sbeauregard66)\
**Post date:** [April 14, 2021, 6:35pm UTC](https://forum.inductiveautomation.com/t/db-query-to-excel-script-no-longer-works-in-ignition-8/45603/3 "2021-04-14T18:35:23Z")

</div>

Yes, of course. That’s it. Thank you very much.
