Jump to content

Recommended Posts

Posted

Hi All,

Can you please check this code and correct it if needed, this approach is not working.

For Inserting or updateing a record in MS Access 2010 through AutoIT3.

Thank you all for your help in advance.

- Sasikumar Nithyanandam :)

$ActionType = "InsertNew" ; _> Here I can define which action to perform, Insert or Update in MS Access.

If $ActionType = "InsertNew" Then
$query = "Insert Into" & $tblTeamMemberTest & " ( Col1, Col2, Col3 ) Values (10,Greetings,Hi)"
ElseIf $ActionType = "Update" Then
$query = "Update " & $tblTeamMemberTest & " Set Col3 = Hello Where Col2 = Greetings"
EndIf

$adoCon = ObjCreate("ADODB.Connection")
$adoCon.Open("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & $dbname & ";")

$adoRsItems = ObjCreate("ADODB.Recordset")
$adoRsItems.CursorType = 1
$adoRsItems.LockType = 3
$adoRsItems.Open($query, $adoCon)

$adoRsItems.Close
$adoCon.Close

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
×
×
  • Create New...