Access 2016 - cannot add new links to External Machine Data Source - ODBC database tables - odbc

I'm running Access 2016 (64 bit) on Windows 10 and only recently noticed this problem. I have several functioning databases that already have a number of working links to tables on two or more External Machine Data Sources. When attempting to add a new link I go through the usual procedure of clicking on "External Data", "ODBC Database" select "Link to the data source by creating a linked table" then go on to select the desired Machine Data Source; at this point the list of available tables comes up and everything seems fine. The problem arises when I select a new table (one I do not already have a link to), click the "Save password" box then proceed: I ultimately end up with an "ODBC--call failed" error that specifies "Error while executing the query (#1)". The first thing I would normally suspect would be a problem with the ODBC driver configuration but all my pre-existing external links continue to function just fine; I only encounter problems when attempting to add new links. How can I find out more about the query mentioned in the error message? Is this "query #1" a universal thing or could it be specific to the way my particular ODBC driver config is set up?

Related

FoxPro ODBC Table not found

The FoxPro ODBC on my machine is only able to connect to certain tables in the ODBC Connection. When I try to connect to specific tables in the same connection I receive the error [Microsoft][ODBC Visual FoxPro Driver]Not a table.( #123). However, I am successfully connected to other tables without an issue. I know these tables I am unable to connect to aren't corrupted because I am able to view the data in them using Visual Fox Pro.
Any suggestions would be appreciated.
First I'd use the Visual FoxPro OLEDB driver instead of ODBC. It's faster and more fully featured.
Then check whether the TableValidate setting is affecting it. To check that, back up the data then open the table exclusively in Visual FoxPro and issue the following in the command window:
append blank
go bottom
delete
pack
This will append and then delete a blank record, forcing the header counters to be recalculated. Then try it via the connection.
Also try turning tablevalidate off for the OLE DB driver as follows.
Create a text file called CONFIG.FPW in the same location as vfpoledb.dll, on a 64-bit machine this will be in 'C:\Program Files (x86)\Common Files\System\Ole DB'.
In the text file just put one line:
TABLEVALIDATE=0
And retry.
First: Do not use ODBC driver UNLESS your tables are VFP6 and earlier compatible. The last ODBC driver released was only for 6 and earlier. If you still need to use ODBC then check Sybase ADS driver. It is compatible with later versions too and local mode is for free.les
Second:Be sure that the tables you are trying to open are really not corrupted (not a table error is often occurs when the header info is off by pne record = you can check the details on "Not A table" entry on foxwikis. You might be looking into two different files when you check from VFP and through OLEDB driver. You can specify the fullpath to be sure.

Visual Studio Server Explorer doesn't display the correct table with DB2 connection

To start off, I'm new to Visual Studio and DB2, so please bear with me. I've been reading different books and will be starting classes soon, but I'm completely stumped with this.
I have a webform set up using VB.
In the web.config file, I've added <add name="rfqAS400TEST" connectionString="Server=serverIP; Database=RFQTST; UID=userid; PWD=password; CurrentSchema=RFQTST;" providerName="IBM.Data.DB2"/> inside of the <connectionStrings> tag. However, when I look at the connection in the Server Explorer, the tables dropdown shows HUNDREDS of tables, none of which are the table I referenced in my connection string.
I've tried to modify the connection and filter by the schema and DbName with no luck - it still only shows the hundreds of other tables instead of the one I want.
When I manually specify a custom SQL statement (SELECT * FROM <library>.<filename/table>) in the GridView Configure Data Source wizard, the GridView displays the records as it should, so I know the connection to the correct library and file is working.
It just seems strange that I have to manually type the statements because the correct table fails to show up in any of the wizards or the Server Explorer. Any suggestions or thoughts would be GREATLY appreciated.
Update
Out of curiosity, I tried to set up the connection using the ODBC datasource and the system data source name as IBM i Access for Windows ODBC. This displays extra tables as well, but it includes the tables that I've been wanting all of this time. This just confuses me more. Does that mean the DB2 connection (even though it technically is connected) is set up incorrectly?
The CurrentSchema is just a proxy for the SET CURRENT SCHEMA, to name the implicit schema qualification, for unqualified table-references. The tables that appear in an ODBC API request such as via SQLTables(), are unrelated to that current_schema.
A generic [db2] provider does not acknowledge\reflect the distinct attributes of the DB2 for i, whereby the database is [in a simplified sense] the entire system; the catalog API calls reflect either that, or that the schemas that are part of the library list concept. With the IBM® i Access ODBC driver, there are Connection string keywords for Connection Properties and Server Properties.
The following Redbooks publication and SQLTables Description may have some value.

Cannot fill azure db with data. WebPage is connected to database but don't want to create tables

I created website using asp.net MVC with Entity Framework Code First. It worked before on Windows Azure, the site was available publicly.
For some reason, I deleted database that was used to store data of my webpage. I created new one, similar to previous one.
I properly connected my site to database (in solution I clicked "Publish", in "Settings" there is place to type data about database, in "Destination Connection String" window I typed all needed data and clicked "Test Connection" - everything seems to be fine)
I published my site, the site works correctly, but when I go to page that gets data from database is see this error:
Invalid object name 'dbo.AspNetUsers'.
In Visual Studio in "SQL Server Explorer" I can see what is in my database. In fact, there is nothing inside (there is one table: "__MigrationHistory" and as I suspect this is created by default).
How can I generate all those tables again? It should generate database structure automatically.
PS: Accidentally I deleted "migations" from my project, do you think this is the cause?
This is not my projects blame, it works OK on localhost on my computer, when I delete localDB, it generates new one without any problem.
Yes, you need migrations. But you can always re-create them (well, if you removed them all it will be initial migration containing all of your previous migrations).
To quick fix you can backup and restore you database on the server. And if you need to re-create migrations do the following:
Backup all your data
Delete the entire database (local and remote), delete all migrations from code.
Create databases (local and remote one).
Run "add-migration Initial" command from PM console
Run "update-database" from PM console.
Upload your code to the server again. If database is empty, new initial migration should be automatically applied.

Connecting my ruby program to an SQLite database using RubyMine

I'm writing a Ruby program to manage courses run at a university, the modules associated with those courses, and the students registered on the courses and modules. I'm using RubyMine to write the program, and I now want to connect what I've written so far to an SQLite database to check that it works as I expect. But I'm not too sure how to do this in RubyMine.
I've opened the database tool window, and it says "No data sources configured", as well as having two "loading" messages at the top of the window.
If I right click on the window, I get a few options, one of which says "Add data source", from which I can add a "DB data source", or a "DDL data source".
I've only ever written one Ruby program before (about 10 months to a year ago), and I used the command line to write it then, also using the command line to create and edit the SQLite database. How can I set up an SQLite database to run with my program from RubyMine?
Also, is there a huge difference between SQLite and SQLite 3? Are there reasons for using one over the other? Which one would people recommend I use?
EDIT 24/08/2012 at 13:50
I tried selecting the option "Run rake tast" from the 'Tools' menu in RubyMine- it then asked me to enter task name or its part, I tried entering "db:migrate", but it said "no matches found".
Any idea what I should do instead?
Please refer to the documentation, RubyMine connects to the database via the JDBC driver. Most likely you want to use SQLite 3 version, as it's the current version at the moment. Check this video for the overview of the Data Sources features.
To connect your program to the database you don't need JDBC driver, it can be done with the sqlite3-ruby gem.
You can also consider some ORM, like Rails ActiveRecord or DataMapper, or Sequel.

Simplest Way to Test ODBC on WIndows

With unixODBC you can use a simple command line utility called "isql" to test your connection and permissions of some queries. Without having to write extra code or install libs or bloated programs, is there a simple way to open up X data source send some sql commands and be done with it?
Doing this on the command line would be preferable.
One way to create a quick test query in Windows via an ODBC connection is using the DQY format.
To achieve this, create a DQY file (e.g. test.dqy) containing the magic first two lines (XLODBC and 1) as below, followed by your ODBC connection string on the third line and your query on the fourth line (all on one line), e.g.:
XLODBC
1
Driver={Microsoft ODBC for Oracle};server=DB;uid=scott;pwd=tiger;
SELECT COUNT(1) n FROM emp
Then, if you open the file by double-clicking it, it will open in Excel and populate the worksheet with the results of the query.
Make a file SOMEFILENAME.udl then double click on it and set it up as an ODBC connection object, username, pwd, target server
You can use the "Test Connection" feature after creating the ODBC connection through Control Panel > Administrative Tools > Data Sources.
To test a SQL command itself you could try:
http://www.sqledit.com/odbc/runner.html
http://www.sqledit.com/sqlrun.zip
Or (perhaps easier and more useful in the long run) you can make a test ASP.NET or PHP page in a couple minutes to run SQL statement yourself through IIS.
For ad hoc queries, the ODBC Test utility is pretty handy. Its design and interface is more oriented toward testing various parts of the ODBC API. But it works quite nicely for running queries and showing the output. It is part of the Microsoft Data Access Components.
To run a query, you can click the connect button (or use ctrl-F), choose a data source, type a query, then ctrl-E to execute it and ctrl-R to display the results (e.g., if it is a SELECT or something that returns a cursor).
a simple way is:
create a fake "*.UDL" file on desktop
(UDL files are described here:
https://msdn.microsoft.com/en-us/library/e38h511e(v=vs.71).aspx.
in case you can also customized it as explained there. )
It's been a while but since I precisely have the answer to the question, I'll share it and maybe someone will benefit from it.
Jaime de Los Hoyos wrote a very nice program to precisely do that: ODBC Query Tool.
Unfortunately, Jaime's website is defunct but you can still find the program and its source code at this location:
https://sourceforge.net/projects/odbc-query-tool/files/latest_release/
The program is GUI based and consists of a single executable file, no need to install anything on the machine.
Jaime's profile : https://stackoverflow.com/users/878998/jaime-de-los-hoyos-m
Jaime's posts on a forum talking about his program : https://forum.powerbasic.com/forum/user-to-user-discussions/source-code/48266-odbc-query-tool-retrieve-information-from-any-database-easily

Resources