Jump to content

MS Access linked database


Recommended Posts

Greetings, 

I have this automation using autoit that checks a linked MS access table. The table is linked on an outlook folder.

The purpose of the automation is to check the mailbox folder if there is a new email. it is named as Mailbox Attendant :)

It is already working but as soon as the new update for outlook releases, the tool is not working anymore. the compiled tool is on 64 bit since it must be aligned with the version of the outlook. I have already installed the 64bit database engine from microsoft.  upon opening of the recordset(execution of query) there is a returncode "rc:-1066598273" and no com error found by the error handler.

 

below is the sample script: 

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <AutoItConstants.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#include <MS_AccessDB.au3>
#include <Array.au3>
#include <Date.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <ListViewConstants.au3>
#include <GuiStatusBar.au3>
#include <ColorConstants.au3>
#include <String.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <MsgBoxConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>

global $EMAIL_DB= ObjCreate("ADODB.Connection")
ConsoleWrite("1"&@CRLF)
Global $EMAIL_REC = ObjCreate("ADODB.Recordset")
ConsoleWrite("2"&@CRLF)
global $oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
ConsoleWrite("3"&@CRLF)
$connection='Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\pakangdula\Documents\MailAttendant\sample_1.mdb;'
ConsoleWrite($connection&@CRLF)
$EMAIL_DB.Open($connection)
Sleep(2000)
ConsoleWrite("4"&@CRLF)
$EMAIL_REC.Open("Select * from [automation1_2]", $EMAIL_DB)
ConsoleWrite("5"&@CRLF)
$count1= $EMAIL_REC.GetRows()
ConsoleWrite("6"&@CRLF)
_ArrayDisplay($count1)
ConsoleWrite("7"&@CRLF)
$EMAIL_REC.close()


func MyErrFunc() ; error handler function
$HexNumber=hex($oMyError.number,8)
Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _
"err.description is: " & @TAB & $oMyError.description & @CRLF & _
"err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _
"err.number is: " & @TAB & $HexNumber & @CRLF & _
"err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _
"err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _
"err.source is: " & @TAB & $oMyError.source & @CRLF & _
"err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _
"err.helpcontext is: " & @TAB & $oMyError.helpcontext _
)
SetError(1)
Endfunc

 

Below is the console output:

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\pakangdula\Documents\FiatMailAttendant\sample.au3" /UserParams   
+>09:25:38 Starting AutoIt3Wrapper v.19.102.1901.0 SciTE v.4.1.2.0   Keyboard:00000409  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\pakangdula\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\pakangdula\AppData\Local\AutoIt v3\SciTE
>Running AU3Check (3.3.14.5)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\pakangdula\Documents\MailAttendant\sample.au3
+>09:25:40 AU3Check ended.rc:0
>Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\pakangdula\Documents\MailAttendant\sample.au3"   
+>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
1
2
3
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\pakangdula\Documents\MailAttendant\sample_1.mdb;
4
!>09:25:49 AutoIt3.exe ended.rc:-1066598273
+>09:25:49 AutoIt3Wrapper Finished.
>Exit code: 3228369023    Time: 11.82

 

Link to comment
Share on other sites

  • Moderators

@pakangdula welcome to the forum. AutoIt has an Outlook UDF that is quite powerful and will make this job a whole lot easier for you.

 

 

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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...