Sharepoint Designer 2007 ODBC database connection to MySQL impossible? - mysql

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?

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.

ERROR [3D000] [MySQL][ODBC 5.3(w) Driver][mysqld-5.7.9]No database selected

I've got WampServer running a local instance of WordPress, and I have SSRS running in native mode.
I've written a report that queries the MySQL database, and it works and runs just fine within Visual Studio.
If I launch it though, it first had issues with my ODBC shared data source, which was as follows:
Name of shared data source: localhost.rds
ODBC Connection string: Dsn=localhostuserDSN
That DSN is a user DSN (as you might've guessed), and it uses the MySQL ODBC 5.3 Unicode driver. It's configured as follows:
TCP/IP server: localhost
Port: 3306
User: root
Password: <blank>
Database: wp
When tested, the connection succeeds, and the report works just fine.
When deployed though, I got the following error:
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
After much research and hair-pulling, I finally found out that if I changed the data source connection string to...
Dsn=localhostUserDSN;Driver=MySQL ODBC 5.3 Unicode Driver
...that also works, and at least then, the connection also succeed when in the Data Sources configuration screen for the report after it's deployed. But then, just when I thought I was finally out of the woods, I run the report and get the following error message:
ERROR [3D000] [MySQL][ODBC 5.3(w) Driver][mysqld-5.7.9]No database selected
The thing is, I can't specify a database, or at least I don't know a way to.
If I try changing the connection string to...
Dsn=localhostUserDSN;Driver=MySQL ODBC 5.3 Unicode Driver;database=wp
...it says the (blank) password isn't valid, before I've even pressed the 'Test' button.
If I tack on 'USE [wp]' to the query in Visual Studio, it abruptly protests.
I thought maybe I'd get around that by putting it in a stored procedure, but since the data is being queried directly from the MySQL database, I can't do that either.
(Before attempting any of this, I already tried syncing/converting the MySQL db to the SQL db, but I kept running into issues with the data conversion.)
Thinking it might be a permission issue, I've also tried running...
GRANT ALL ON [wp] TO root#localhost;
...and...
GRANT ALL PRIVILEGES ON [wp] TO root#localhost;
in SSMS, but in both cases, it says:
Cannot find the object 'wp', because it does not exist or you do not have permission.
And I'm the only admin on a local machine. I installed SQL and it uses Windows Authentication, so I don't see how I wouldn't have permission, and I have to assume it's an issue with the syntax.
I saw elsewhere here that someone suggested '[wp].*', but it doesn't like that either.
I've been at this literally all day, and I'm at my whits end, so any constructive feedback would be greatly appreciated!
For anyone stumbling across this in the future, I think we resolved the original issue, although I've run into other issues which may be specific to me.
Three things, not sure if the first one is related:
1) In the query for the dataset of the report, I specified the table like so "SELECT wp_posts.ID FROM wp_posts" instead of just "SELECT ID FROM wp_posts".
2) I went back to adding on "database=wp" to the ODBC connection string.
3) Even though both work in Visual Studio, I switched to a System DSN instead of the User DSN.
I think that should get you back in action.

Problems importing MySQL data into Access 2010

I have a small database with 10 tables in it - of those, 6 import directly into Access via an ODBC connection to a MySQL database without any issue. However, 4 of them throw an error: "Could not open the object"
The MySQL ODBC driver is 3.51 -- anything greater didn't work at all and it was suggested on the MySQL.com support site to use 3.51 instead.
I can also import these into Excel without any trouble... so I am not sure if the issue is with Access or the ODBC driver..
I've seen this issue happen with MySQL tables containing field types that Access/Jet doesn't understand and that the MySQL ODBC driver doesn't fully translate enough for Access to map to a known field type (to Access). I know it's been a bit of time - but do you think you could post a description of your table(s) that are having trouble? Perhaps you could get more MySQL/Access people in here answering your issue (if I can't, that is).

SSIS data Import from MySql

I am working with SSIS and trying to import data from MySql to SQL Server. I am having issues trying to convert mySql datetimes to SQL Server Datetimes. Any suggestions?
Can you provide an example of the error or problem? I found some values in MySQL were out of range to SQL Server. In these instances, I used a NULLIF on the MySQL side to remove the bad values first. Rafal Ziolkowski's solution of converting to strings could work as well, but I personally would prefer to push the conversion off to the MySQL query if it is only impacting data columns.
Try convert date to string and then to datetime again.
What is the issue? Which SSIS data type are you using? DT-DBTIMESTAMP should work for both.
this took me few days to figure out...so I thought I would share my notes
How to connect and load data from MySQL to SQL Server
Download the 32 bit ODBC driver.
go to the MySQL website and download: “mysql-connector-odbc-5.2.4-ansi-win32.msi”
NOTE: Do not use the 64 bit driver on BIDS 2008. BIDS 2008 is 32 bit. You will get a mismatch error when creating SSIS’s connection manager: “The specified DSN contains an architecture mismatch between the Driver and Application”
Create a User DSN
You need to open the using windows 32 ODBC admin tool. DO NOT open the regular ODBC admin, in control panel. Open the ODBC admin located here: c:\Windows\SysWOW64\odbcad32.exe. If you use the default ODBC admin…it will not work. Additionally you must create a “User DSN” - NOT a System DSN. Otherwise it will not show up in SSIS
NOTE: the screens look the same so you will have no way of knowing whether you are in 32 BIT ODBC Admin tool or not.
Create a new SSIS package and create an ADO.NET connection manager:
Change the Source ADO.NET properties.
You will get validation errors and your package will not run. You need to change the “ValidateExternalMetadata” to FALSE (in the “Advanced Editor” dialog box) of the ADO.NET source It will also give you metadata error…that’s ok…just click ok. It will still pull the metadata (column names/data types). You cannot select the tables as you would in SQL server. You need to type the SQL select statement.
Run the package and should run and load normally.

Migrating from MS SQL to MySQL: SQLOLEDB? Migration kit login error?

I've been put in charge of migrating a customer's website of MS SQL/ASP to PHP/MYSQL. I have zero experience with MS SQL.
I'm trying to figure out the best way to get the current data migrated to MySQL so I can begin PHP development.
Some details:
I downloaded SQL Server Mangement Studio Express. I found the following string in a connection file:
MM_connCompanyName_STRING = "provider=SQLOLEDB;data source=IP_ADDRESS;database=DATABASENAME;uid=USERNAMEpwd=PASSWORD;"
Using the IP, username, and password from this string, I could successfully connect using Studio Express.
I downloaded the MySQL Migration Toolkit and entered the same info, but get the following error:
Connecting to source database and retrieve schemata names.
Initializing JDBC driver ...
Driver class MS SQL JDBC Driver
Opening connection ...
Connection jdbc:jtds:sqlserver://IP_ADDRESS:1433/DATABASENAME;user=USERNAME;password=PASSWORD;";charset=utf-8;domain=
The list of schema names could not be retrieved (error: 0).
ReverseEngineeringMssql.getSchemata :Login failed for user 'USERNAME'.
I don't have admin or physical access to the current SQL server. I've tried to run some exports through Studio Express, but it saves them to the file system, which I don't have access to.
I can reach the current/old webmaster, but because he no longer works for the company, his responses are slow and usually un-helpful. So no help there...
The former admin sent me an MDF file ... no idea what to do with that.
I found this note above the connection info on the current server (if it means anything):
'this connection is being used because
ODBC was causing weird errors,
switching to OLEDB fixed them
My questions:
Any idea why this would be failing with the same login credentials that works with Studio Express? I'm assuming it has something to do with the driver, but I don't know what next steps to take.
Is there a better/easier/more effective way to migrate this data? (I'm hoping I don't find myself running "SELECT *" statements in Studio Express and copy/pasting data into Excel...please god, no)
Thanks in advance for your help.
Eww, this is going to be scary (connection string indicates it was tool generated from Dreamweaver, never a good sign).
Any idea which version of SQL Server? You should be able to SELECT ##VERSION. 10.x is 2008, 9.x is 2005 and 8.x is 2000. If it is 7.x run.
The MDF file is the actual database. If I were you, I would buy a developer edition of SQL 2005 (or 8 if it is 2008 which is unlikely), it will be worth the $99 or so it costs.
This will give you the ability to locally install the DB by ATTACHing the MDF file. Once you have a locally running copy, you can use the SQL Server ETL tools with the MySql ODBC drivers to push the data to MySql in a repeatable manner.
I believe you can export data from MSSQL choosing different SQL dialects; I believe there's one that's reasonably MySQL compatible. It doesn't solve all your problems, of course, because while you may get the structure properly, stored procedures and triggers and the like will take a bit more work. But that should get you started.