Wena Posted August 7, 2012 Share Posted August 7, 2012 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 AlistairSQL2EXCEL.au3 Link to comment Share on other sites More sharing options...
Juvigy Posted August 8, 2012 Share Posted August 8, 2012 (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 August 8, 2012 by Juvigy Link to comment Share on other sites More sharing options...
Wena Posted August 8, 2012 Author Share Posted August 8, 2012 Thanks Juvigy. I will give it a try shortly. Regards Alistair Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now