• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 770
  • Last Modified:

Error connecting to MySQL via ODBC from Mocrosoft SQL Server Reporting Services.

I have a unique situation which i have not seen before.
I wrote reports and they are hosted on an SQL server reporting services 2000 portal.
This has always been working well and all reports were running fine until recently when out of the blue, both reports fetching data from MySQL repositories failed to run.

I created liked servers to mysql using the ODBC provider for Microsoft ODBC data sources.
I have tested the linked servers and I can browse the tables and even query for data successfully from enterprise manager and query analyser, however when I try to run any query from a report project in Visual Studio to any of the MySQL linked servers (just like I do it in Query analyser (using OPENQUERY function), I get the following error:

-------------------------------------------
Microsoft Development Environment
An error occurred while executing the query.
ERROR [23000][MySQL][ODBC 3.51 Driver][mysqld-5.0.67]You have an error in your SQL syntax; .......
-------------------------------------------


When i refresh the dataset in Visual studio, I then get another error:
-------------------------------------------
Could not generate a list of fields for the query.
Check the query syntax or click refresh fields on the query toolbar.
There is already an open DataReader associated with this Connection which must be closed first.
-------------------------------------------

When i run the query from Query analyser, it works perfectly!
The reports have not been changed. Could someone have got such a problem before? If so, how was it resolved?

Here's the environment in subject:
1. Visual Studio dot net 2003
2. DotNet Framework 1.1
3. SQL server 2000.
4. MySQL ODBC driver 3.1 (for Windows)
5. Windows 2003 server.
0
Chris M
Asked:
Chris M
  • 3
2 Solutions
 
gtkfreakCommented:
You can investigate in the mysql log file. In linux the file is named mysqld.log in the /var/log folder. However, in windows, I suspect it would be named similarly or somewhere else in an event log there. Sorry, not knowing exact place in Windows.

BTW, did you upgrade any databases or install any patches that broke it?
0
 
Chris MConsulting - Technology ServicesAuthor Commented:
Hi gtkfreak,
querying through the link directly using SQL server works perfectly but the issue seems to be with trying to query through the link from dotNet.
With SQL server's Enterprise manager and Query analyser, MySQL can be accessed perfectly. The linked server is fine and I can see the MySQL tables from SQL server's Enterprise manager. With Query Analyser, i can query the MySQL tables too.
If the problem was with MySQL, i would not have been able to see the data with SQL server's Enterprise manager, Query analyser and via ODBC.
The problem starts when I try to query MySQL from Visual studio.
0
 
Chris MConsulting - Technology ServicesAuthor Commented:
I highly suspect that Windows updates destabilised the drivers on the OS.
I cannot work with the link anymore but decided to write the report going directly via a MySQL DSN, not via the link to MySQL.

This resolved it!

Thanks for all your posts team.
0
 
Chris MConsulting - Technology ServicesAuthor Commented:
gtkfreak, thanks for your contribution.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now