Jump to content

Sqlite and global-messages-db.sqlite thunderbird


Recommended Posts

hi guys  why  if i open global-messages-db.sqlite with navicat  i can read  data inside of  them and  when i try to open with autoit 

return me  blanc  table ?

#include <SQLite.au3>
#include <Array.au3>



_SQLite_Startup()
If @error Then
        MsgBox($MB_SYSTEMMODAL, "SQLite Error", "SQLite3.dll Can't be Loaded!" & @CRLF & @CRLF & _
                "Not FOUND in @SystemDir, @WindowsDir, @ScriptDir, @WorkingDir, @LocalAppDataDir\AutoIt v3\SQLite")
    EndIf
Local $hDB = _SQLite_Open("C:\Users\SviluppoGest\Desktop\global-messages-db.sqlite")
If @error Then
        MsgBox($MB_SYSTEMMODAL, "SQLite Error", "Can't create a memory Database!")
EndIf

Local $aRows, $iRows, $iCols,$iRval
$iRval =_SQLite_GetTable2d($hDB, "select c0body,c1subject,c2attachmentNames,c3author,c4recipients from messagesText_content where c1subject = 'Test' AND c3author = 'noreply@spedirecomodo.it';", $aRows, $iRows, $iCols)

;   $iRval = _SQLite_GetTable($hDB, "select c0body,c1subject,c2attachmentNames,c3author,c4recipients from messagesText_content where c1subject = 'Test' AND c3author = 'noreply@spedirecomodo.it';", $aRows, $iRows, $iCols)


_ArrayDisplay($iRows)
for $x = 1 to UBound($aRows)-1
    ;ConsoleWrite($aRows[$x][0]&"-"&$aRows[$x][1]&"-"&$aRows[$x][2]&$aRows[$x][3]&"-"&$aRows[$x][4]&"-"&@CRLF)
    ;Run ( @ScriptDir & '\SumatraPDF.exe -print-to-default ........????
Next

_SQLite_Close($hDB)
_SQLite_Shutdown()

 

Link to comment
Share on other sites

Insert error handling code and report which error occurs where.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

not  return error

#include <SQLite.au3>
#include <Array.au3>




_SQLite_Startup()
If @error Then
        MsgBox($MB_SYSTEMMODAL, "SQLite Error", "SQLite3.dll Can't be Loaded!" & @CRLF & @CRLF & _
                "Not FOUND in @SystemDir, @WindowsDir, @ScriptDir, @WorkingDir, @LocalAppDataDir\AutoIt v3\SQLite")
    EndIf
Local $hDB = _SQLite_Open("C:\Users\SviluppoGest\Desktop\global-messages-db.sqlite")
If @error Then
        MsgBox($MB_SYSTEMMODAL, "SQLite Error", "Can't create a memory Database!")
EndIf

Local $aRows, $iRows, $iCols,$iRval
$iRval =_SQLite_GetTable2d($hDB, "select c0body,c1subject,c2attachmentNames,c3author,c4recipients from messagesText_content where c1subject = 'Test' AND c3author = 'noreply@spedirecomodo.it';", $aRows, $iRows, $iCols)
If $iRval = $SQLITE_OK Then

    Else
        MsgBox($MB_SYSTEMMODAL, "SQLite Error: " & $iRval, _SQLite_ErrMsg())
    EndIf

;   $iRval = _SQLite_GetTable($hDB, "select c0body,c1subject,c2attachmentNames,c3author,c4recipients from messagesText_content where c1subject = 'Test' AND c3author = 'noreply@spedirecomodo.it';", $aRows, $iRows, $iCols)


_ArrayDisplay($iRows)
for $x = 1 to UBound($aRows)-1
    ;ConsoleWrite($aRows[$x][0]&"-"&$aRows[$x][1]&"-"&$aRows[$x][2]&$aRows[$x][3]&"-"&$aRows[$x][4]&"-"&@CRLF)
    ;Run ( @ScriptDir & '\SumatraPDF.exe -print-to-default ........????
Next

_SQLite_Close($hDB)
_SQLite_Shutdown()
>Running:(3.3.14.5):C:\Program Files\AutoIt3\autoit3.exe "C:\Users\SviluppoGest\Desktop\da-cancellare\thunder.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
+>17:21:49 AutoIt3.exe ended.rc:0
+>17:21:49 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 1.146

 

Edited by faustf
Link to comment
Share on other sites

your "error" is here:

_ArrayDisplay($iRows)

 

Edited by orbs

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

There must be an error somewhere.

What gives "select * from messagesText_content"

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

??? Remove $iRval = and use _SQLite_Display2DResult($aRows) to view output in console.

_SQLite_GetTable2d($hDB, "select c0body,c1subject,c2attachmentNames,c3author,c4recipients from messagesText_content where c1subject = 'Test' AND c3author = 'test@gmail.com';", $aRows, $iRows, $iCols)

_SQLite_Display2DResult($aRows)

Anyway, you can see my solution here

PS: verify my query, because it is not complete, you only have to intercept new emails, otherwise you have duplicates.

CIAO

Edited by rootx
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...