Generating a SQL UniqueIdentifier

G

Guest

I have an Access 2003 front end to a MS SQL 2000 database. One form uses
data from a view. I have no trouble updating the table underlieing the view,
but in order to add data, I need to pass a value back in a field of data type
(SQL) uniqueidentifier. The field is the key on the underlieing table and
set to Not Null, so it fails before my INSTEAD trigger can take over.

Can anyone tell me if there is an Access equivalant to the SQL newid()
function, or if not, how to generate the uniqueidentifier?

Thanks for your assistance,

John
 
G

Guest

The solution provided a way to generate a GUID. Unfortunately, I can't get
the GUID into my rows when a new one is being created. The View that I am
working with is linked as a table via ODBC. I have a Before Insert trigger
(ASccess) on the maintenance form and have tried a myriad of approaches to
putting a GUID into the relevant row in that procedure, getting a variety of
error messages.

This leads me to question if Access actually understands what a GUID is?
The row in question was defined as a Number of type Replication ID when I
linked the table. I can't find any documentation references to a Replication
ID.

The value that gets passed to the SQL database is irrelevant as a legitimate
GUID is applied by the INSTEAD OF trigger on the server. As a test I tride
to assign a value of 10 to the GUID column and got an error message that the
value is too large. I have tried the GUIDFromString function which gives me
a 16 byte GUID, but then how do I get it into the cell?

So now I'm down to wondering what am I missing? Do I need to detach the form
from any table(s) and just fetch and update data when the user identifies and
changes existing data and apply a similar methodology to inserts and deletes?

Any insights would be appreciated.

Thanks again,

John
 

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