Jump to content

Sqlite data to excel


Wena
 Share

Recommended Posts

Hi

I have searched and searched this forum and connot seem to find an answer to my problem.

It is proberly an easy solution.

I have created a SQLITE DB and need to export it to excel.

I get it to write to consol.

Could some one point me in the correct direction.

Attached is my script.

Regards

Alistair

SQL2EXCEL.au3

Link to comment
Share on other sites

I think this would work:

$oDb = ObjCreate("ADODB.Connection")
$oDB.Open ("odbc connection here") ;;Be sure to change ODBC name here/Control Panel Administrative tools
$oSQLRS = $oDB.Execute ("Select * From Database")

While not $oSQLRS.EOF
$array1 [$i] [0] = $oSQLRS.Fields(2).Value ;ID
$array1 [$i] [1] = $oSQLRS.Fields(9).Value
$array1 [$i] [4] = $oSQLRS.Fields(1).Value
$array1 [$i] [5] = $oSQLRS.Fields(3).Value
$array1 [$i] [6] = $oSQLRS.Fields(6).Value
$array1 [$i] [7] = $oSQLRS.Fields(0).Value
$array1 [$i] [8] = $oSQLRS.Fields(4).Value
$array1 [$i] [9] = $oSQLRS.Fields(50).Value
$oSQLRS.MoveNext
WEnd

And then you just write the $array1 to excel with the _ExcelWriteArray

Edited by Juvigy
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...