MS Access Export via ODBC to Specific DB2 Schema - ms-access

I am trying to export a table from MS Access (2007) to DB2 (9.7 LUW) using ODBC. I can do this, as long as I export the table into my own schema.
However, I would like to export the table to another schema. How can I get Access to put the table into another schema? In Db2, the table foo within schema bar is normally referred to as bar.foo. However, if I enter this as the target to export to, Access gives me an error:
The object name 'bar.foo' you entered doesn't follow Microsoft Access object-naming rules.
This is because it won't accept a period in the table name. Does anyone know how I can overcome this limitation? I can just copy the table over after the export, but some other users don't have permission to create tables in their own schema; thus, this is preventing them from exporting from Access.
Thanks for your help.

Remou suggested using a query like this:
SELECT *
INTO [ODBC;<db2 connection string>].schema.table
FROM ms_access_table1
I believe something similar could be made to work for DB2. I suggest trying this if anyone needs a solution. I have decided to stick with my current kludgy approach, however. It is a shame that Access's export feature can't do this for such a dumb reason.

Related

Using Snowflake ODBC Driver with MS Access

I am trying to access my tables in Snowflake using MS Access. I am able to make the connection to make a connection between them and see the list of all my tables but the I am getting all my tables (from all Databases and Schema) even if I have specifically mentioned the Database and Schema to be accessed when creating the Data Source Network(DSN).
And when I try to open a table i get the message: "Cannot define field more than once."
The table which I am accessing has a copy under different database. But, the table name and schema name is same.
ex:
DATABASE_A.SCHEMA.TABLE1
DATABASE_B.SCHEMA.TABLE1
Does anyone has any idea how to resolve this issue?
I can confirm that if you have two Snowflake databases with the same table name you experience this problem. I have been beating my head against a wall and your question gave me the clue. I was able to delete my other database in Snowflake and the error that you described disappeared.
I have come across another problem though but that will be for another SO question.

Microsoft Access export via ODBC - ODBC Error 1265

I am trying to export a datatable from Microsoft Access 2016 via ODBC Export to a MariaDB. I have tried:
do a right click on the datatable and choose "Export" --> "ODBC-Database"
then choose the preconfigured ODBC User-DSN
Then I get the ODBC-Call Error:
"ODBC-Driver[...] Data truncated for column 'TotRev' at row 1 [#1265]"
I have tried different codings, as I got other error codes before which were related to that.
I would really appreciate a hint for this solution. The used Database is MariaDB with utf8-mb4 encoding.
Having no familiarity at all with MariaDB - my only suggestion is to export out of Access to a neutral format; either text file or excel.
Then on the MariaDB side - import the neutral file.
I have solved the problem: One specific characteristic with Access is that there exists a datatype currency. This is the problem and so the question is how to get rid of it. Just changing the datatype did not work, as Access run out of memory. The reason is, that Access tries to keep both tables (old datatype + new datatype) in memory.
To solve this problem I found a nice explanation on Microsoft pages. What I did is to follow the hint on this page:
Microsoft forum entry by John W. Vinson/MVP
Here his advice:
"[...]An alternative way to accomplish this task requires a couple of steps but works with any size table:
Rename the table to tablename_old
Copy and paste it to tablename, using the option design mode only
Change the datatype in the new empty table
Run an Append query to migrate the data
It may be necessary to drop and reestablish relationships.[...]"
As I am not familiar with Access here the link to office support how to append an query
Add records to a table by using an append query

Import MySQL file into Oracle SQL Developer

I have tried to find an answer for this elsewhere but cannot, I hope someone can help me.
I am trying to import the MySQL sample database into Oracle SQL Developer.
I have an existing database/connection I want to dump it into. I have created an empty table named classicmodels in my existing connection. Yes that name is only 1 table within the sample db, correct. Ignore the error in naming convention.
When I R-click on it and try 'import data' I cannot import a .sql file, I can only do it with XL, CSV, etc.
When I try and run a script it found on dba.stackexchange
#\path\mysqlsampledatabase.sql , I get a series of 'please provide substitution value' messages, which does not make sense to me given that I am importing a database which is built for SQL (ie what reason is there to substitute).
Pictures below:
The 'UnseenCollection' is a single table I imported as a csv file. I need to import the mysqlsampledatabase file such that it shows up the same way, I can access all tables within the sample db.
Anyone can help I would appreciate it. I need the end result to be the entire mysqlsampledatabase to populate within the 'classicmodels' node.
Thank you.
connect to MySQL
connect to Oracle
for a single MySQL table, right-click, 'Copy to Oracle'
for a few tables, select, drag and drop onto Oracle connection (requires newer version of SQL Developer)
for an entire MySQL database, use the migration project feature

MSACCESS 2002 Linked Table Performance Really Slow

Am trying to import some selective data and create a table in MS Access db 2002 from a linked table. For some odd reason the performance became really bad all of a sudden when importing the data.
I tried googleing and tried various methods like reparing/compacting the db, Changing the SubDataSheet Name to [None] from [Auto] but either one worked.
Can any one please give me some examples to increase the performance of linked tables.
Thank you.
Rather than selecting information from a linked table and trying to make a local table, when using a database server like MS MSQL, you would be better to create a "Pass Through Query" to do the select work on the server side, and then carry out a simple select * on this pass through to get your data in to a local table. This will give the best results if your first select statement is complex and takes a while for Access to run on a linked table, if that is not the issue then you will need to look at your network speed which connects you to your MS SQL server.

Getting Rid of DBO? SQL 2008

Just wondered if there was a secret to do something like Database.Security.Users like AdventureWorks DB is setup. Seems no matter what I do to try to setup "Security.Users", I always get the dbo in front of it and have a hell of a time in C# accessing the info. Am I doing something wrong?
Are you trying to create an object called Security.Users with a dot? (as opposed to Users in the Security schema?) That's probably best avoided as you're seeing, but if you are then the best way to quote the name is probably in square brackets, i.e. [Security.Users].
dbo is the default database schema name. Unless you've configured a different default schema for your users etc. you can usually just ignore it, although it's still needed if you're referencing another database by name.
you first need to create a schema and make that schema the default schema for that user. Examples and more info can be found here: http://msdn.microsoft.com/en-us/library/ms190387.aspx
If you are using the Wizard to create this, you will always get it. Write the SQL statements and you should be fine.