Jump to content
Sign in to follow this  

MS Access linked database

Recommended Posts


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 ****
#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")
Global $EMAIL_REC = ObjCreate("ADODB.Recordset")
global $oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
$connection='Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\pakangdula\Documents\MailAttendant\sample_1.mdb;'
$EMAIL_REC.Open("Select * from [automation1_2]", $EMAIL_DB)
$count1= $EMAIL_REC.GetRows()

func MyErrFunc() ; error handler function
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 _


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.   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 (  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\pakangdula\Documents\MailAttendant\sample.au3
+>09:25:40 AU3Check ended.rc:0
>Running:(\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
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\pakangdula\Documents\MailAttendant\sample_1.mdb;
!>09:25:49 AutoIt3.exe ended.rc:-1066598273
+>09:25:49 AutoIt3Wrapper Finished.
>Exit code: 3228369023    Time: 11.82


Share this post

Link to post
Share on other sites

@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!

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...