Jump to content
Sign in to follow this  

Export txt file from MDB file based on SQL statment

Recommended Posts


Dear all:

Please tell me how to connect to MSAccess MDB file with a password, then make a select statment and export the results to txt file.

Parameters used:

MDB = test.mdb


Password= Pass

export file= out.txt

SQL stament = Select * from table1 where myname=$name and birthday=$date

$name and $date will be entered in a box window and the date is date formate.

Thanks in advance.

Share this post

Link to post
Share on other sites


You will get responses if you actually post code that you tried writing.

Here are the steps to get you started.... :D

1. Create AutoIT GUI (Window)

2. Create Label and Text boxes to receive $name and $date

3. AutoIt does not have a date data type, so perform some validation.

4. Use ADO and ADOX libraries to connect to/open Access Mdb

5. Use ADO Recordset to run the SQL statement and retrieve the data.

6. Create a Text File (Or alternate hack is to start notepad and send the data to it)

7. Use Ado Getstring to dump the data, save the file, etc.

Hope this helps.

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.