Thanks for the info.  I think the easiest thing is to re-design the
underlying forms.  I use a database independent development platform, which
generates sql for me from the form. This application has to run on various
DB's (Access, MS SQL Server, MySQL, Oracle, etc)

It's a good learning experiment:)  The query/view option was in reality a
cheat to get things done and working.

Regards
Brian


-----Original Message-----
From: Daniel Kasak [mailto:[EMAIL PROTECTED] 
Sent: Sunday, February 08, 2004 3:27 PM
To: Brian L. Walter; [EMAIL PROTECTED] Mysql. Com
Subject: Re: Migration question


Brian L. Walter wrote:

>Thanks for your reply.
>
>Let me try again.
>
>In access, you can create views.  These are called 'queries' in Access.  
>The current version of MySQL does not support views, as I understand 
>it.
>
>Using DBManager, I import all my tables and data to MySQL from Access.  
>One of the options during the import is to import queries.  My 
>application depends on using these structures (call them views if you 
>wish).
>
>Since I can import them, and see them in the database, is there a way 
>that my application can access them?
>
>Currently using odbc against the Access database, I treat them just 
>like a table i.e, select * from query_name where etc etc.
>
>When the application attempts this against the MySQL database, I get an 
>object does not exist error.
>
>If it's not possible, I'll have to restructure the application.  This 
>isn't a trivial task, but, not impossible.
>
>I'm not using Access as a front end, I'm migrating the database from 
>Access to MySQL.  Just wondering how the various parts of an Access 
>database map to parts in the MySQL database...
>
>Hope this is a clearer explanation.
>
>Brian L. Walter
>Service Data Management
>"We treat our customers like our future depends on it" www.sdm1.com
>  
>
OK. Clearer.

What you want to do is currently impossible. As you already know, views 
are not supported by a current version of MySQL. DBManager has been 
designed to work with a number of DB servers, so the option of importing 
views is for the benefit of others...

How about taking the SQL from each of your Access queries ( I'd hardly 
call them views in Access ) and putting them into some global variables 
in your code? eg:

global const v_customers as string

v_customers = "select * from customers"

and then append on any conditions you want before running the query.

It *may* be possible to do almost what you want with MySQL-5.0.x, by 
entering your views in as stored procedures. eg:

create procedure sp_customers(customer_id) as
select * from customers where id=customer_id

and then to retrieve the results, use:

call sp_customers(500)

( which would select customer with id=500 ).

You should be able to get this working with the development version of PHP.

For this to work with ODBC, however, you'll have to vote for bug #2273, at:
http://bugs.mysql.com/bug.php?id=2273

MyODBC doesn't currently allow this behaviour. Not sure why. But please 
vote for the bug, even if you don't use ODBC...

Dan

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.580 / Virus Database: 367 - Release Date: 2/6/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.580 / Virus Database: 367 - Release Date: 2/6/2004
 



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to