Which connection type would I use to interface PMI with an Access database?
Thats what we made the JDBC-ODBC bridge connection for. Unfortunately, there isnât a pure JDBC driver for MS Access. Certain things [probably] wonât work, such as automatic table browsing, etc. Youâve been warned.
Normal queries should work fine though.
I also tried this once, then slapped myself and ran into a corner and cried
Would highly recommend against using Access to drive your project. Use this if you need to access data against an existing source that gets updated (ie canât copy static data over to a real DB).
Iâll take another look for Access JDBC drivers - itâs been awhile. There are probably native drivers that you can purchase. It isnât too bad to configure FPMI to use any JDBC driver. Post if you have questions, weâll help you with it.
As much as I hate to revive a topic on MS Access I have no choice.
I have project built using MSSQL storing all of my machine conditions. However, all of the product scheduling programs are handled by the IT department and in Access. Currently whenever a product changeover occurrs the database is supposed to "push" the data to SQL. Sometimes this does not happen and I end up storing data with the wrong order information.
Since I cannot change the system in use by production I would like to be able to query the Access table and store the data to SQL on a data change. I cannot get a working connection. I have tried both system and user DSN. Testing the connection works but when I test it in the query browser I get this ...
Any ideas?
For the sake of clarity, it seems that TimEâs error is occuring in FactorySQL instead of PMI, which this thread was started on.
On to the task at handâŚ
If you go to Help->Log Viewer and look through the errors there, is there anything that seems relevant that could provide more info?
What happens when you create a simple group, drag one item into it, and hit start? If it says âTable not availableâ, click âNoâ to indicate that you donât want to continue, and then double click the message that appears. If it seems to have more info, post it up here.
Also, what version of FSQL are you using?
Regards,
Thanks for the reply Colby,
The only error in the log was the one in my first post.
Here are some more test results
FSQL Data Connection name = âAccess_RollPGMâ
FSQL Group Name = âL3OrderNumTestâ
I created an OPC item and set the group to write to table name: âtestâ
[quote]08/25/08 8:51:35
L3OrderNumTest
Connection not available, user canceled.[/quote]
Here I created an action item to query an existing table: âCurrentRollDetailâ
[quote]Error executing item Item: Invalid object name âAccess_RollPGM.CurrentRollDetailâ.
at FactorySQL.Items.AccessoryActionItem.Execute(EvaluationToken Token)
at FactorySQL.Groups.FSQLGroup.EvaluateActionItems(Boolean Triggered, EvaluationToken EvalToken)
at FactorySQL.Groups.FSQLGroup.InternalExecute(EvaluationToken EvalToken)
Invalid object name âAccess_RollPGM.CurrentRollDetailâ.
at FactorySQL.Items.AccessoryActionItem.Execute(EvaluationToken Token)
at FactorySQL.Groups.FSQLGroup.EvaluateActionItems(Boolean Triggered, EvaluationToken EvalToken)
at FactorySQL.Groups.FSQLGroup.InternalExecute(EvaluationToken EvalToken)</[/quote]
I am using version 4.2.5
I created a datasource connection on the gateway (3.2.3) and have this error
My connect URL is: jdbc:odbc:Access_RollPGM
[quote]Message: (hide details)
[Microsoft][ODBC Microsoft Access Driver] â(unknown)â is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
Details:
SQLException
sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
com.inductiveautomation.factorypmi.gateway.db.DatasourceManager$DSInfo.runTest(DatasourceManager.java:578)
com.inductiveautomation.factorypmi.gateway.db.DatasourceManager$FaultedDatasourceRetryer.run(DatasourceManager.java:441)
java.lang.Thread.run(Unknown Source)[/quote]
Are you sure the ODBC connection is configured correctly in windows, and that itâs pointed to a valid access database file?
Just a guess, but it seems that the error is saying that the file path itâs trying to use is â(unknown)â⌠and the file path is part of the odbc configuration, so Iâd double check that.
Regards,
You need to create a âSystem DSNâ ODBC connection in Windows named: Access_RollPGM
To create that MS Windows ODBC connection for the FactoryPMI ODBC<â>JDBC bridge:
- control panel->administrative tools->Data Sources (ODBC)
- Click âSystem DSNâ tab
- Click âAddâŚâ and configure a connection to your Access database. Make sure to name it: Access_RollPGM
Iâll make a training video on this soon.
It is configured as a âSystem DSNâ. I can browse the connection with Kepwareâs data logger and view the tables.
I just installed OpenOffice and I am able to open the database using the same ODBC connection.
In your connection configuration in FactorySQL, is the âTranslatorâ setting set to âAutomaticâ or âAccessâ? If automatic, try setting it explicitly to access.
I tried both settings and still no joy.
Iâm confused - are you having trouble with Access in FactorySQL or FactoryPMI?
Both.
To summarize:
In FactorySQL:
If I try to write to access I get a âConnection not availableâ
If I try to query I get âInvalid Object Nameâ
In FactoryPMI:
Tyring to setup a new datasource connection:
â[Microsoft][ODBC Microsoft Access Driver] â(unknown)â is not a valid path.â
NOTE:
The ODBC connection works with other programs.
Silly question, but is the FactoryPMI Gateway on the same machine as the System DSN?
Yes
Maybe a a GoToMeeting would help clear this up, feel free to give us a call.
Solved! Turns out his mdb file was sitting on a shared fileserver, and the âLocal System Accountâ that the FactoryPMI and FactorySQL services were set to log onto didnât have access to that shared drive. We switched the âLog On Asâ settings on both the services to proper domain accounts, and the connections started working.