Programatically create ODBC connection and link tables in MS Access - oracle

We are using MS Access as a reporting front-end for Oracle. The data is accessed via an ODBC connection, and there are two linked tables in Access to Oracle that are the raw data tables. I'd like to be able to set up the connection and link the tables from within the Access file. That way users don't have to worry about setting up an DSN for the ODBC connection (most of them are not very technical users, and will require hand-holding for something like this), and we can eventually have the Access file point to different test environments and generate reports.
Is it possible to have the database connection created dynamically when the file is opened, and can I dynamically change where my Linked Tables link to?

You want a DSN-less linked table connection from Access. It is possible and I've done it but I don't have the code with me. I think it was something like the below (this uses a SQL Server source but Oracle would just have a slightly different connection string). To have the table(s) created on startup you'll need to check for the existence of each tabledef prior to attempting to create them again and call a subroutine like the below upon Access database open.
Function LinkTables()
Dim DB As Database, tDef As TableDef
Set DB = CurrentDb
Set tDef = DB.CreateTableDef("YourAccessLinkedTableNameHere")
tDef.Connect = "ODBC;Driver={SQL Server};Server=srvname;Database=dbname;UID=sqluserid;PWD=sqlpwd"
tDef.SourceTableName = "dbo.YourSourceTableNameHere"
DB.TableDefs.Append tDef
End Function

I do my programming on a workstation with a DSN defined, and then before distributing for production use, run a variant of Doug Steele's code to convert all the DSN-based connect strings to be DSN-less.

Related

Informatica Workflow Cannot create proper Relational connection object to connect to SQL Server

On my Infa server PC, in Informatica Administration I created a repository service giving Oracle Database information. Once in Informatica I connect to this repository and there I want to create a mapping importing a table from a remote sql server pc (on my home network domain) and then create a workflow to put the data into an oracle target table.
Using ODBC admin console I created and tested the connection and I am also able to telnet the linked sql server and port.
Within informatica I created a relational connection for sql server and when I run the workflow I get the error reason (14007) failed to create and inituiate OLE DB instance and datatabase driven error, failed to connect to database using user I use in SSMS for windows authentication and connection string(). I would like to know, first of of all, if I am doing something wrong, willing to connect me to a repository with oracle database information and then use a sql server table on remote pc. Do I have to create another repository for Sql server and there use sql server tables or I can mix them? secondly I would like to know how to create a relational connection object in informatica for my linked sql server so that it will be the same of relatonal connection created with ODBC admin consolle. Last but not least I would like to understand why gives an error out saying I left connection string empty, when I cannot see a place where I can put it by creating the relational connection object
I might not be able to solve the problem completely, but here's few remarks that might be helpful:
PowerCenter Repository database is where PowerCenter will store all the metadata about the processes you create. It may be Oracle - that's perfectly fine. And as it is not releated to your data sources or targets, you do not need to create another one for different sources/targets. One is enough for all ot them.
Using PowerCenter Workflow Manager create the appropriate connections to all the systems you need. Here you create the connections that indicate ODBC/other connections that will be used by Integration Service to actually connect to your data sources and targets, hence
Make sure the ODBC / other data sources are specified on Intergration Service. It is the IS that will run the process, connect to systems specified in the process with the defined connections.
When you build the mappings, you create them in a client app (Mapping Designer) and you can connect to DB engines to create source and target definitions. Mark, that in such case you use the connection (eg. ODBC data source) defined on the client. Once you will try to actually run the workflow with the given mapping, it is executed on IS (mentioned above) where appropriate connections need to be defined - and that's completely separate.
When editing a session in a workflow, for each source and target you need to pick a connection defined in Informatica Repository, created as described in point 2 above (or use a variable to indicate one - but that's another story)
So the error you mention seems to be related to connection created in Workflow Manager - it probably does not specify the connection string that should refer the data source defined on IS.

Can Toad (for Oracle) connect to a database I've created in my computer?

I've created a database via MS Access & I've created some tables within it. I want to know if it's possible to access it via Toad & how can I achieve it.
I managed to create the DB, but I'm seeing that Toad has three options for connection: TNS Names, LDAP or Direct (I don't really know the difference between the three). What would I need to do to connect it successfully?
I'm expecting to be able to login to my Database using Toad & do queries on it.

MS Access: Creating a linked table in design guide view does not show the tables to link to?

In MS Access 2010 I am trying to create a linked table to an Oracle table.
When I use the traditional way of doing it via the MS Access menus:
External Data > ODBC Database > Link to the data by creating a linked
table
I cannot see the tables on my Oracle server that I should be able to choose from. The form is empty, even though I know there are many tables at my server.
What is the problem here?
Could it be that the ODBC connection that I'm forced to use is System DSN inside the "ODBC Data Source Administrator" overview under control panel.
NB: The connection is working in other programs, so that is not the problem.
PS: I can off course do it via VBA code instead, which can be done as shown here:
Template code taken from here: https://www.techonthenet.com/access/modules/link_table.php
Here the template code from the link:
DoCmd.TransferDatabase acLink, "ODBC Database", "ODBC;DSN=AAAA;UID=BBBB;PWD=DDDD;SERVER=CCCC", acTable, "schema.table_name", "Access_table_name", False, False
And here the comments from the link:
Please note that you'll need to customize the above line of code, so
that:
AAAA is the name of the ODBC Data Source that you set up. BBBB is the
user name that you will use to log into Oracle. CCCC is the name of
your Oracle server. DDDD is the password that you will use to log into
Oracle. schema.table_name is the table in Oracle that you wish to link
to. For example, "collect.suppliers". Access_table_name is the name
that you'd like Access to assign to the linked table. For example,
"suppliers".
When using the menus, you need to pre-specify a database in the DSN (Dbq parameter in a connection string).
If you don't pre-specify a database, MS Access won't know in which database to look for tables, and it won't do all or all it has access to, so it just does none.
Make sure that the ODBC driver matches your Access version
32 bit Access <--> 32 bit ODBC
64 bit Access <--> 64 bit ODBC
You have some good comments here. If you launch the ODBC panel from the control panel, it will launch the x64 bit version of the ODBC manager. However, most versions of Access are x32 bits.
The most simple way to ensure that your using the correct bit size ODBC manager is to let Access launch the ODBC panel for you. (and it often helps if you right click on your access shortcut and choose run as administrator.
As others noted, when you setup the DSN, do two things:
Make sure during the creating of the connection, you select the database (the default is usually system and that will show a whole bunch of system tables, but none of the ones you want - you want to pick/choose your database. It should appear in the drop down.
The SQL server (not oracle) during the several panels will show this where you choose the database:
VERY important, you also want to check the "save password" box - this ONLY appears during the create of a new DSN - if you miss this, then re-linking will never prompt you for the password - so don't forget this option:
The above panel will show regardless of what ODBC you use - don't forget to check the save password.
Next up:
create a FILE DSN. The reason for this is that Access converts this to automatic to a DSN-less connection for you. That means you can move the database to other machines, or even delete the DSN you created. Access ONLY uses the DSN at link time - after that it not required (however, this advice ONLY applies to a FILE dsn - so that's what you want to create.

Oracle APEX 5.1 connect to remote db using JDBC and query data

I have only used db links to get access to remote db so far. Now I have to find a way to use JDBC to connect to remote db and get data. Can someone guide me what all things would I need to ask the remote db admin in order to setup a jdbc connection, and once I have the connection, how do I query the database using java stored procedure, just like I am querying it over remote db right now with db link?
You've described a fairly complicated problem, but haven't given any information about your database or operating system. Are you connecting to a SQL Server database? MySQL? Are you running on Linux? Windows?
First, you'll need a driver. That's going to depend on the database, operating system and versions thereof that you're using. For example, here is the Microsoft ODBC Driver for SQL Server (Oops, looks like it's currently unavailable.)
Second, you need to set up Oracle Heterogenous Services. That's fairly complicated and not something I can answer here. You might start with the Database Gateway for ODBC User's Guide.
Oracle does have gateways for various other databases, but they're licensed additionally from the database itself.

Accessing SAP Pool Table A016 from Sql Developer

We have two divisions in our company, one uses E1 on Oracle 11g the other uses SAP on Oracle 11g.
We also have a SQL Server system we use to data warehouse information once a night from both system to run our report server against.
The question I have is for pooled tables in SAP, such as A016, how would I get that information out of SAP?
Currently we have SSIS's setup with a linked server to the two Oracle servers which pull the data we need I just don't have the knowledge of SAP to find the Pooled tables.
if I can't pull the pooled tables because they don't physically exist is there a tool I can use in SAP to find out what tables the pooled table is getting it's information from? This way I can rebuild that table in SQL using a open query and some fun Joins.
Thanks
You have to access those tables using the application server. They can't be accessed directly from the database.
You'll probably want to write an ABAP program to extract the data you need go from there.

Resources