Showing posts with label link. Show all posts
Showing posts with label link. Show all posts

Friday, March 23, 2012

Named Calculation, Referencing a field from a linked table

Is there a way to reference a field from another table in a named calculation.

Ex: Table movies has a link to table theatre, in the theatre there is a display code, the display-name of the movie should be comp.comp_displaycode + ' - ' + mov.mov_name.

I know i could do this in a view and than use the view instead of the movies table, but if it is possible in the Datasourceviews it would be easier.

Try replacing table in the DSV with named query joining 2 tables.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights

|||This is very similar to defining views, i just hoped that there was a syntax available to do it.

Monday, March 12, 2012

mysql to crystal report

i have my db at mysql, but i need to link it to crystal report to make a report for my company.
how can i do it?
thanksYou can use ODBC or OLE DB, but you need to install ODBC or OLE DB driver of MySQL.|||how to install odbc or ole in mysql?|||how to install odbc or ole in mysql?
No, not to install ODBC in your MySQL, but in your PC.
After installation finished, then select your data source to ODBC which
using MySQL ODBC driver.|||Download MySql Connector/ODBC (http://dev.mysql.com/downloads/connector/odbc/3.51.html) and after installation.

Go to ODBC Data Source Adminiostration -> System DSN - >Add -> MySQL ODBC 3.5 Driver and set the server information.

Then you can use this connection in the Crystal Report.

Friday, March 9, 2012

MySQL linked in SQLServer

:confused: Hallo! I'm trying to link a MySql 's DB in SQLServer with ODBC: the operation was susseful but I'm not able to read and write/update the data.
HELP ME PLEASE!!!
silvia, ItalyI'm confused by "the operation was successful" followed by "I'm not able to read and write/update the data". I don't understand what you mean.

Check out sp_addlinkedserver (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_adda_8gqa.asp). If you tinker with the link a bit, you ought to be able to get it in Italian if that helps.

The quickest and easiest way is to use the ODBC link that uses a system DSN. That way if you change MySQL servers all you do is fix the DSN and your SQL Server link works.

A more complex but more powerful way is to use the ODBC with a connection string. It is kind of like a car with a manual transmission... You have more control, but you have to pay more attention to how you use it.

-PatP|||IF I RIGHT CLICK IN A TABLE IN THE REMOTE SERVER, I FIND ONLY "COPY" AND "?". IT'S CORRECT??

ciao e molte grazie!!!
silvia|||Without knowing a lot about your system(s), I can only guess. What you describe is one possible outcome of a linked server to MySQL that is actually fairly common.

There are two problems that commonly interfere with cross-server operations.

The most common problem is that the MySQL login used by the ODBC connection doesn't have sufficient permissions within MySQL. The only real solution for that problem is to get more permissions by either changing the MySQL login used by the ODBC connection to one that has more permissions, or by getting the MySQL administrator to grant the MySQL login used by the ODBC connection more permissions.

The next most common problem is that the MySQL ODBC driver on the SQL Server itself is old. The ODBC drivers have improved a lot over time. Older drivers (sometimes even a few months can make a real difference) are often a problem. Visit the MySQL site to see if you can get newer ODBC drivers.

-PatP|||I have set up a link server to MySQL 5

Sometimes mySQL do require a password. The following link server works for me.

EXEC sp_addlinkedserver ‘mysqlDB’, ‘MySQL’, ‘MSDASQL’, Null, Null, ‘Driver={MySQL ODBC 3.51 Driver};DB=mysql_db;SERVER=mysql_server;uid=userna me;pwd=password’

If MSDTC is running you can use the following to create a view without a link server.
SELECT * FROM OPENROWSET(’MSDASQL’,'Driver={MySQL ODBC 3.51 Driver};DB=mysql_db;SERVER=mysql_server;uid=userna me;pwd=password’, ‘SELECT * from table’)

If you get an error like
OLE DB provider 'MSDASQL' returned an unexpected data length for the fixed-length column '[MSDASQL].pensionNo'. The expected data length is 7, while the returned data length is 5.

You can resolve this using the option tag
'Driver={MySQL ODBC 3.51 Driver};DB=mysql_db;SERVER=mysql_server;option=512 ;uid=username;pwd=password'

Notice the option=512