2

I'm getting data as an Access file.

My application uses PostgreSQL/Java. I'd like to convert the Access database to PostgreSQL. can any one help me to code this

6
  • show us your code so we may help you Commented Dec 26, 2013 at 6:36
  • thanks Nguyen...i have done code to connect ms access and postgres(two seperate connection).i dont know how to continue...how to get the table structure... Commented Dec 26, 2013 at 6:37
  • Can you create an ODBC DSN which points to your PostGreSQL db, and then use DoCmd.TransferDatabase from an Access session? Commented Dec 26, 2013 at 16:15
  • @HansUp can u explain DoCmd.TransferDatabase it is VB is nt it.... i dont know VB Commented Dec 27, 2013 at 4:49
  • 1
    Possible duplicate of Convert Access to PostgreSQL? Commented Aug 9, 2019 at 19:23

1 Answer 1

0

I doubt there is any simple automatic method. You will have to create ddl statements to make the tables in postgresql (not sure if you can export ddl from access), export the data from access to a csv, and then use postgresql copy from command to populate the tables.

Or you could consider trying this tool:

http://docman.sourceforge.net/home_html/projects/sql/exportSQL3.txt

but it looks like a dev version, it may not be mature.

Sign up to request clarification or add additional context in comments.

3 Comments

I thought you just needed to do a one time conversion. You need to write a java program that will convert MS Access databases to postgresql databases? This sounds like a very big project. I think you need to show us what you've coded so far.
.i have done code to connect ms access and postgres(two seperate connection).i dont know how to continue...how to get the table structure.
Neither do I, unfortunately. If this were Oracle you could pull it out of the metadata. I think you need someone who knows access better than I do.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.