Access VBA: Convert Access tables to arff format

Weka, an open source data mining software, uses arff input data format. You can use this code to convert any Access table to arff format. Download the Access database with code: Convert2Arff.mdb

This can very well be designed using forms, but this should get one started. Use Alt + F11 to see the code, then execute procedure ConvertTbl2Arff to convert a table.

Some highlights of this procedure
– Takes care of spaces in Attribute name and data values
– Finds unique values of nominal variables
– Assigns equivalent ARFF datatype
– Replaces missing values with question marks

About the Author

The author of Tableau Data Visualization Cookbook and an award winning keynote speaker, Ashutosh R. Nandeshwar is one of the few analytics professionals in the higher education industry who has developed analytical solutions for all stages of the student life cycle (from recruitment to giving). He enjoys speaking about the power of data, as well as ranting about data professionals who chase after “interesting” things. He earned his PhD/MS from West Virginia University and his BEng from Nagpur University, all in industrial engineering. Currently, he is leading the data science, reporting, and prospect development efforts at the University of Southern California.

  • Wal says:

    Where could I download Convert2Arff.mdb? By e-mail is ok. Thank you!.

  • a7n9 says:


    Sorry, while upgrading to wordpress, my files got lost. I have updated this post with the correct link. Thanks.

  • Troy says:

    Thank you very much for this helpful tool.
    I hope you update this for the new version of MS Access and WEKA 🙂

    I have an Access database with 100,000+ rows and sample of 6 columns! Man, this worked perfectly!

  • n.ashutosh says:


    Thank you for your kind note; I’m glad this helped you out. You know, I should update this post, because I’m sure there are easy ways to do this. One of these days.

  • says:

    What is the reason for this error:
    for this line: Dim rs As ADODB.Recordset
    *compile error:User-defined type not defined*

  • >