Solution to integrate an Oracle Database in 800xA (PG2).
Previously from VB we had data acces of a Oracle database of ours, we upgraded to PG2 and were not succesful. We tried to use the same data access in PG2 as we used in VB with the help of a ActiveX Wrapper. But with this Wrapper the DB-Access was not working.
We actually need to be able to select the Data form the data base in PG2 an transfer them to the 800xA to use them in the program.
.In ActiveX „Microsoft DataGrid Control 6“ it’s not possible to choose the ActiveX „Microsoft ADO Data Control“ (called “DataSource”)
Anybody would know of another way or solution where from PG2 it is possible to access a oracle database of ours? and so be able to display it in the 800xA system?
Voted best answer
VB code is no longer possible to use.
The future of wrappers in future versions of System 800xA is also a bit uncertain - wrappers open doors to a lot of good but also nasty things.
The workplace can easily become stuck on custom code running inside VB controls and wrappers. There are no "sandboxes" where such code can "explode or become stuck" without harming the workplace process and/or memory.
Wrappers also contributes to additional overhead and memory usage - this may slow down or even hamper a workplace from running smoothly.
I've spent numerous of hours explaining why synchronous calls should be avoided in a realtime environment. Just because a synchronous "SELECT ..." statement typically return in fractions of a second it may block due to an unforeseen bug/problem
A VB control or wrapper must not block, e.g. if the DB connection become hung. Producing such code is more complex than traditional sequential/synchronous "Basic" programming.
The preferred way of getting data into PG2 is OPC DA - So I recommend pursuing a solution where the DB accesses can be realised with OPC DA.
There may exist ready made solutions (but I can't name one, sorry). Building an custom aspect system is also an option; where you can make use of something called DA Injection method to expose properties (e.g. from a database) as OPC items to be brought into your display.
It is possible to access databases including Oracle and MS-SQL, by using a Scripting Aspect. You just need to be a bit creative to read the data from PG2 :-)
You may use VBScript and create an ADODB.Connection object. Use Google to get examples on how to use ADODB.Connection (and ADODB.Recordset)
Do NOT 'Use Safe Subset'.
Be aware of all the problems that Stefan wrote in his answer!