SQL Server uniqueindentifier field
From: Bob Fleischman (bob.fleischman_at_automateddocsys.com)
Date: 06/21/04
- Previous message: Phil: "freeing an adodataset query"
- Next in thread: Brian Bushay TeamB: "Re: SQL Server uniqueindentifier field"
- Reply: Brian Bushay TeamB: "Re: SQL Server uniqueindentifier field"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 21 Jun 2004 16:41:31 -0400
We are trying to use a SQL database with a uniqueidentifier primary key via
an ADODataset.
dtmdlQueryObjects.tblSQLObject.Open;
dtmdlQueryObjects.tblSQLObject.Insert;
dtmdlQueryObjects.tblSQLObjectSQLObjectName.Value := 'zz_TryMe';
dtmdlQueryObjects.tblSQLObjectSortOrder.Value := 1;
dtmdlQueryObjects.tblSQLObject.Post;
ShowMessage('After Key: ' +
GUIDToString(TGuidField(dtmdlQueryObjects.tblSQLObject.FieldByName('SQLObjec
t_ID')).AsGuid));
The SQLObject_ID field always returns all Zeros.
{00000000-0000-0000-0000-000000000000}
We have tried many permutations of cursors and property settings with no
luck.
Has anyone got this to work??
Thanks
Bob Fleischman
Here is sample DDL for the table
CREATE TABLE [dbo].[SQLObjects] (
[SQLObject_ID] uniqueidentifier ROWGUIDCOL NOT NULL ,
[SQLObjectName] [varchar] (255) NULL ,
[SortOrder] [int] NULL ,
) ON [PRIMARY]
GO
- Previous message: Phil: "freeing an adodataset query"
- Next in thread: Brian Bushay TeamB: "Re: SQL Server uniqueindentifier field"
- Reply: Brian Bushay TeamB: "Re: SQL Server uniqueindentifier field"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]