how to add Guid in Primary Key automatically, in "Replication ID"field size type?

O

Omer kamal

When in database(.mdb) the primary key have fields size type
"Replication ID" it creates Guid.

I tried to create string of Guid and insert it but did it not work.

Control.databindings.add(), Method for this field is only working one
way that,it is not saving back the data into table.

I wonder if there is some way so it creat automatic Guid when I add new
field?

I notice in Long integer "field size" type it does itself but not in
Guid (Replication ID) case.



Regards,
omer kamal
 
S

Scott Roberts

Omer kamal said:
When in database(.mdb) the primary key have fields size type
"Replication ID" it creates Guid.

I tried to create string of Guid and insert it but did it not work.

Insert the Guid as a string enclosed in {} (e.g. '{guid_string}').

To have SQL Server automatically generate a Guid when you insert a row, set
the default value for the column to "(newid())".
 

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