dle

PostgreSQL

Recommended Posts

Probably.  You just need to find a 32 bit ODBC connector for PostgreSQL.  DAQFactory connects to all databases via ODBC and really doesn't know exactly which database you are working with.  ODBC makes this transparent.

Share this post


Link to post
Share on other sites

I would like to automatically log data from DAQFactory to a database in PostgreSQL. I followed this website to configure an ODBC driver for PostgreSQL. Then I created an Export Set and changed the settings so that it uses ODBC Database as Export Method. What are the next steps? I am completely new to these platforms so any help is much appreciated! Thanks!

ODBCDriverSettings.png

ExportSetSettings.png

Share this post


Link to post
Share on other sites

First, make sure the ODBC connection works by clicking on the Test button in your ODBC configuration.  Also, make sure you created the ODBC data source in the 32 bit version of the control panel applet, and not the 64 bit version.  DAQFactory, as a 32 bit app, only connects to 32 bit data sources.

You can quickly verify that the ODBC is accessible from DAQFactory by going to the command alert window and typing:

global dbase = db.open("DAQFactory")

That will try and open the data source named "DAQFactory".  If it just does it without any message, then you are probably good.  If not, it will display an error message.  If it does work, you'll need to close the connection by then typing:

db.close(dbase)

Next, I would probably recommend a logging set if you are just getting started.  It is largely setup the same way, except you just select the channels you want to log.

Finally, I do not know the dialect of PostgreSQL, so you might have to click the SQL button in the logging/export set next to where you put the data source and tweak the SQL commands to match what PostgreSQL uses.

Share this post


Link to post
Share on other sites

Thank you! When I clicked Test, the connection worked. I had the wrong version installed, but now I have the 32 bit version. I tried global dbase = db.open("DAQFactory") but an error popped up and I'm not sure why. The error: 01002 Unable to open ODBC database: Line 1

Share this post


Link to post
Share on other sites

Make sure you didn't put a user/password on the data source itself.  This is different than the user/password the data source uses to access the database, but if you don't know better, maybe you put the same user/password in both places.

Share this post


Link to post
Share on other sites

Unfortunately I don't know the details of the setup for every ODBC data source.  From your screen shot, I would try clicking the DataSource button next to options in your ODBC configuration and see if there is a user/password there.  I would also make sure you don't have another ODBC data source with the same name.  I don't actually know if it matters, but make sure you don't still have a DAQFactory data source in the 64 bit ODBC.

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