Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Create View in Access 2013: is it possible?

1,892 views
Skip to first unread message

jce...@gmail.com

unread,
May 27, 2013, 8:49:11 AM5/27/13
to
I've tried by using the syntax
CREATE VIEW view [(field1[, field2[, …]])] AS selectstatement
as mentioned here http://msdn.microsoft.com/en-us/library/office/ff836312.aspx
But it does not work (Syntax error in CREATE TABLE statement. (Error 3290))

Bob Barrows

unread,
May 27, 2013, 11:12:00 AM5/27/13
to
Please show us a simplified example of what you tried, rather than
copy-pasting the syntax from the documentation. We can't troubleshoot what
we can't see.
My guess as to your problem:
You failed to turn on ANSI-92 SQL in the database options. Without that
turned on, you cannot execute CREATE VIEW in the query builder. You can,
however run it via VBA code. You can test this in the Immediate window by
pressing ctrl-G and entering something like:
currentproject.connection.execute "create view myview as select ... from
mytable"


jce...@gmail.com

unread,
May 28, 2013, 12:13:30 PM5/28/13
to
Thank you so much Bob, that was it
I am trying to avoid VBA usage just because I need to list all tables in a database, and for each table display the column names. I succeeded in doing this through a VBA function but it is not visible from outside the Access application (I mean I need to call that function from a Java program, which seems to be not possible).
Thanks a lot again

Bob Barrows

unread,
May 29, 2013, 7:03:48 AM5/29/13
to
jce...@gmail.com wrote:
>
> Thank you so much Bob, that was it
> I am trying to avoid VBA usage just because I need to list all tables
> in a database, and for each table display the column names. I
> succeeded in doing this through a VBA function but it is not visible
> from outside the Access application (I mean I need to call that
> function from a Java program, which seems to be not possible).
> Thanks a lot again

OK, I thought you were running the CREATE VIEW statement in the query
builder simply to test it before putting it into code. Now I am at a loss as
to why you are using it at all. Creating a view simply involves saving a
query contained in the query builder. Without parameters, it is exposed to
external code as a view, but is simply a saved query in the database. If you
do parameterize it and save it, it is exposed to external code as a stored
procedure, but in Access of course it's simply a saved parameter query.


0 new messages