Sign in to follow this  
Followers 0
Michael Lester

Writing Records To Microsoft Access With Autoit (using Dao)

3 posts in this topic

Does anyone have an example (as simple as possible) showing how to use DAO to extract data and add data to a table in MS Access?

Thanks

Mike Lester

Share this post


Link to post
Share on other sites




“Give a man a script; you have helped him for today. Teach a man to script; and you will not have to hear him whine for help.”AutoIt4UE - Custom AutoIt toolbar and wordfile for UltraEdit/UEStudio users.AutoIt Graphical Debugger - A graphical debugger for AutoIt.SimMetrics COM Wrapper - Calculate string similarity.

Share this post


Link to post
Share on other sites

Does anyone have an example (as simple as possible) showing how to use DAO to extract data and add data to a table in MS Access?

Thanks

Mike Lester

Basic stuff in this post should be a good start:

http://www.autoitscript.com/forum/index.ph...topic=19597&hl=

_SelectData()

Func _SelectData($dbname = "C:\FullPathToDatabase.mdb", $tblname = "MyTable", $T = "*")
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $dbname)
$RS =ObjCreate("ADODB.Recordset")
$RS.ActiveConnection = $addfld
$RS.Open ("Select " & $T & " From " & $tblname )

msgbox(0,"", "Name: " & $RS.Fields(0).Name & " - Value: " & $RS.Fields(0).Value & @CRLF & "Name: " & $RS.Fields(1).Name & " - Value: " & $RS.Fields(1).Value & @CRLF & "Name: " & $RS.Fields(2).Name & " - Value: " & $RS.Fields(2).Value)

$RS.Close
$addfld.Close

EndFunc

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  
Followers 0