Sign in to follow this  
Followers 0
Wena

Sqlite data to excel

3 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Thanks Juvigy.

I will give it a try shortly.

Regards

Alistair

Share this post


Link to post
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
Sign in to follow this  
Followers 0