How to restore ODBC connection after failure in MS Access - ms-access

There is a MS Access application with tables on MS SQL Server linked through ODBC. When connection is lost i receive ODBC error 3146. After connection is restored physically i still receive ODBC 3146 errors. I have to make something like a reconnect to server. How can i do this in MS Access?

I think all you need to do is refresh the table links. Are you asking how to relink the tables programmatically? Have you tried refreshing the links after being disconnnected and verified that it solves the problem? Refreshing the link in VBA would be something like
Dim db as Database
Set db = Currentdb()
db.TablesDefs(1).RefreshLink
You may have to loop thru the tables to get the index I am not sure if it will take the table name but you could try it that way first.

Where is your Access table in reference to your SQL Server? If your Access table is local and you are the only one using it then refreshing table links is sufficient. However, if the Access db lives on a server or some other shared space where many people are using it they will not be able to access the SQL tables if you are using a USER DSN. Setting up a system DSN or a dsn file will provide Access with the information it is looking for as to where the SQL tables are.

Related

SSIS No Tables or Views Could be Loaded Error with Oracle 12c ODBC

We are trying to set up an ODBC Destination object in a SSIS package and getting a "No tables or views could be loaded" error (see screen shot below). The schema is relatively new and we are able to do this with an older schema in the same database.
Some observations:
We are able to successfully make a connection to the schema both through the Windows ODBC administrator and from the SSIS connection manager.
We are able to display tables from ANOTHER schema that is the same database.
We are also able to display tables in the schema causing the error if we do so by connecting to another schema (see more below).
More on #3 above. Let's say we have schemas/users MySchemaA and MySchemaB and MySchemaB is the one we want. If we connect directly to MySchemaB, it doesn't work. But if we grant MySchemaA rights to see tables in MySchemaB and connect to MySchemaA... we can indirectly see the tables granted in MySchemaB through the connection to MySchemaA. Hopefully clear as mud.
Any ideas how to fix this?
Since this is a new schema, does something need to be setup on the DB side to allow this?
We using Oracle 12c and have installed the necessary drivers. Also using ODBC administrator 32-bit to set up a system DSN.

How Can I stop the users from accessing ODBC?

I have a mysql backend and a ms access 2013 frontend, I configured a odbc connection at system level so it´s available to all users in the computer. But Now I realized that you can easily just open a new database and pull all my tables from that odbc connection and see the credentials.
I´ve already try with user level odbc, the database simply doesn´t log.
How can I stop the users from being able to do such a thing?
Use a DSN-less connection plus connection caching.
Both are explained in this answer: https://stackoverflow.com/a/23430539/3820271
Then distribute your frontend as accde, so the source code isn't available.

What is wrong in my setup of a Pervasive ODBC connection from Access?

I'm trying to connect an Access 2010 database to a Pervasive dataset. My computer is Windows 7 32 bit. I've set up an ODBC connection through the ODBC administrator, but when I try to open a table in Access 2010 I get a message saying the ODBC connection has failed. What am I doing wrong?
So I've set up an ODBC connection. When I test it, the test completes successfully.
Then I go to Access and use the linked table manager to change the link to the database. The link seems to be refreshed successfully.
However, when I try to open the table, I get a message saying "ODBC-call failed" with no further information
Also, I can open the Pervasive client on my machine and view the table, it's just in Access I can't view it.
Any help would be appreciated.
Check the design of "pr_earn", possibly is different from the design of the table you were using .
The design is not automatically updated in MSAccess. An alternative is to remove and link the table again.
best regards!

Connection lost from mysql remote odbc with MS Access

Hi I am using MS Access and have used mysql odbc to connect to a remote mysql server database. I have already set ip address on cpanel remote mysql section to allow my ms access database to connect with that. I managed to link to this database from MS Access and linked tables are imported in my ms access database but as soon as I try to open those table from ms access I get message that connection lost. What could be the reason why connection is lost when I try to open remote mysql database table in MS Access. Is this some firewall stopping it .. what could be the solution. If Cpanel has remote mysql then does it not mean that it supports remote access. I want to have a non disconnecting connection with my ms access database and possibly I have a plan to extend it to multiple users and convert this to a single database and multiple users application with each user with a copy of access database. Kindly reply thanks.

Sharepoint Designer 2007 ODBC database connection to MySQL impossible?

I'm trying to create a Database Connection to ODBC data sources in SPD 2007 and am having absolutely no luck. I've had some success using an SqlDataSource control, however. I don't know if SPD's database connection support is just broken or what. Googling has turned up others having issues but no definitive answers.
So, my two data sources are MySQL 5.1 ODBC and ProvideX ODBC. I pretty much have the same trouble with either, so I'll just focus on MySQL.
I've got a system DSN on the machine running SPD that is successfully connecting to the MySQL database. (This DSN also exists on the server running Sharepoint, if that matters at this time).
In SPD, I go the Data Source Library, expand Database Connection, and choose Connect to a Database. I then click on Configure Database Connection. Since neither of the providers in this dialog are appropriate, I choose "Use a custom connection string". I then set the provider to "Microsoft .Net....ODBC" and at this point I've tried the following connection strings.
First the DSN attempts:
Dsn=TheOneICreated (this one works from the SqlDataSource control)
and
Data Source=TheOneICreated
Then the more direct approach:
Driver={MySQL ODBC 5.1 Driver};Server=myServerIP;Database=dbName;User=username;Password=password;Option=3
The error I get back is always the same -
"Server Error: An error occurred while
retrieving the list of Databases from
: The server for the data source
returned a non-specific error when
trying to execute your query. Check
the format and content of your query
and try again. If the problem
persists, contact the server
administrator."
Am I fighting a losing battle here?
It looks like SD could be enumerating databases and/or tables so it has a list of tables and fields to 'help' you along....
Just a clarifying question or two..
Could this happen because SD is expecting a different way of enumerating tables? (Does it actually work with MySQL or anything ?)
What does your ODBC trace look like? (If #1 is true, you'll be able to see it and possibly create supporting views...if you truly need it to work with this particular dbms...)
Is this connection accessed from the sharepoint server? If so, do you need to define your dsn & driver there?