CREATE VIEW

D

David

I'm learning SQL with MS ACCESS and my attempt to create a view is not
working...
Your assistance is appreciated. I'm good at ACCESS, just new to SQL from
scratch!

CREATE VIEW ProductCustomers
(cust_id, cust_contact) as
Select cust_id, cust_contact
from Customers;

I always get "SYNTAX ERROR with TABLE STATEMENT and VIEW is highlighted.
 
D

David

Thank you Pieter... however, even though I cut and paste your code, I still
get the same error : SYNTAX ERROR with TABLE STATEMENT

I'm using ACCESS 2003 if this helps.
Thanks again for your time and talent.
Dave
____________________________________________________________
 
D

Douglas J. Steele

Access doesn't have views. Queries essentially are the same as views, so
create a query named ProductCustomers with SQL

Select cust_id, cust_contact
from Customers;
 
D

David

Actually, that's what I was thinking. The idea with SQL VIEW is that you can
write a query that concatenates etc then use the results in other Selects...
but unless the database is gigantic, I don't see the need for a seperate VIEW
in MS ACCESS. Thanks for clarifying...
 
V

vanderghast

Maybe the easiest way is to use the Debug Immediate window:


CurrentProject.Connection.Execute "CREATE VIEW ProductCustomers AS
SELECT cust_id, cust_contact FROM Customers;"



rather that trying it in the SQL Query window.



Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top