>> ODBC link to SQL view read only

J

Jonathan

Hi, using Access 2003 I want to programmatically link to a sql view. Access
can recognise the unique id field in a view when I manually link to sql
through a popup dialog.

How do I tell Access the unique id field programmatically?

Any ideas or suggestions appreciated :)

Many thanks,
Jonathan
 
R

Rick Brandt

Jonathan said:
Hi, using Access 2003 I want to programmatically link to a sql view.
Access can recognise the unique id field in a view when I manually
link to sql through a popup dialog.

How do I tell Access the unique id field programmatically?

Any ideas or suggestions appreciated :)

That popup is not *Access* recognizing the unique field it is *you* telling
Access which field(s) to use precisely because it does not know. When you
do so it builds a local unique index that it can use for updates. If you
link to a view (or a table with no unique index) with code then you have to
include code that builds the unique index on the desired field(s).

Check help file for the CREATE INDEX Statement.
 
J

Jonathan

Hi Rick, thank's for your response. I have just found that when creating the
view if I include with schemadata in the script Access does seem to recognise
the unique key. That is the view is read/write.

Many thanks,
Jonathan
 
J

Jonathan

Oooops I mean

WITH SCHEMABINDING

Jonathan

Jonathan said:
Hi Rick, thank's for your response. I have just found that when creating the
view if I include with schemadata in the script Access does seem to recognise
the unique key. That is the view is read/write.

Many thanks,
Jonathan
 

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