Inserting and accessig Image (bmp) data in an SQL 2005 database.
- From: "Larry Killen" <lkillen@xxxxxxxxxxx>
- Date: Sun, 28 Oct 2007 12:36:47 -0400
I want to be able to store and retrieve bit map images to an MS SQL
database.
My test table struvture is:
USE [YieldPlusNG]
GO
/****** Object: Table [dbo].[QCButtonSettings] Script Date: 10/28/2007
12:20:26 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[QCButtonSettings](
[BtnID] [int] IDENTITY(1,1) NOT NULL,
[BtnCaption] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[BtnScore] [int] NOT NULL CONSTRAINT [DF__QCButtonS__BtnSc__51300E55]
DEFAULT ((0)),
[BtnImage] [image] NULL CONSTRAINT [DF__QCButtonS__BtnIm__5224328E]
DEFAULT (''),
[Abbr] [char](2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
I insert the data using:
INSERT INTO [YieldPlusNG].[dbo].[QCButtonSettings]
([BtnCaption], [BtnScore], [BtnImage],[Abbr])
VALUES ('bmp' ,20, 'C:\temp\ImageBlob\Pictures\btn3.bmp' ,'SC')
A cursory view of the table in the Management Studio shows that the data
appears to be inserted. For a sanity check, I threw a datasource and a
simple query in a form and bound it to a TdbImage. In attempting to view
the Image in design time I get a "BitMap Image is not Valid".
I have open and resaved teh images in Paint to insure they were standard 24
bit BMP's.
Can someone get me started on saving and retrieving image data?
Thanks
Delphi 2006 Ent. Win32
SQLExpress 2005
.
- Follow-Ups:
- Re: Inserting and accessig Image (bmp) data in an SQL 2005 database.
- From: Brian Bushay TeamB
- Re: Inserting and accessig Image (bmp) data in an SQL 2005 database.
- Prev by Date: Re: Access SQL Server Express over the Internet
- Next by Date: Re: Stored proc timeout issue
- Previous by thread: Stored proc timeout issue
- Next by thread: Re: Inserting and accessig Image (bmp) data in an SQL 2005 database.
- Index(es):