🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.database.bdp
Article #40

How to load\save blobs with DBWeb

#40
From: Bill Walton
Date: Thu, 08 Feb 2007 08:57
49 lines
2671 bytes
Hi

I have project where I have a BDPConnection, BDPDataAdapter, DataSet,
DBWebDataSource, DBWebNavigator and DBWebGrid all connected together to
display\edit a table from an database. This all works fine.

However, one of the columns I also want to edit must be editied using a
3rd party control (fckEditor for html editing) on the form. Its a BLOB
field as well.


What is the correct\best way of synchronising my fckEditor's value with
those of the DBWebDataSource so as when I finally ApplyUpdates, my
DataSet has the correct values for each row ready to be posted ? At the
moment I have got the DBWebDataSource's OnScroll event to be :


procedure TWebForm2.wdsMain_OnScroll(sender: System.Object; e:
Borland.Data.Web.OnScrollEventArgs);
var
  LRowDropped: boolean;
  LType: System.Type;
begin
  wdsMain.SetColumnValue(tblDisplay_List, e.PriorRow, colDescription,
FCKeditor1.Value, LRowDropped);
  if e.CurrentRow<tblDisplay_List.Rows.Count then 
    FCKeditor1.Value:=wdsMain.GetColumnValue(tblDisplay_List,
e.CurrentRow, 'DESCRIPTION', LType).ToString
  else
    FCKeditor1.Value:=cNewPageText;
end;

The idea being that when ever I scoll through the dataset, any changes
made in the fckEditor are sent back to the dataset for the 'PriorRow'
and then the next value is loaded into the fckEditor for the
'CurrentRow'. This so that when I do apply updates, the data is in the
dataset. Unfortunatly, when I insert a row, the dataset doesnt seem to
have the new row in it, so the above code falls over the on the first
line saying 'Row XYZ doesnt exist'. In other words e.PriorRow is out of
bounds.

Am I going about this completly wrong ? There must be a set way of
reading\writing to controls other than DBWeb based controls so as your
dataset\DBWebDataSource stays in sync ready for you to ApplyUpdates..

Any help, much appreciated!
Cheers
Bill.
-- 
Technical Details
Message-ID: <45cae5f7@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 1effeb,5966be0f83466965,start
X-Google-Attributes: gid1effeb,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Bill Walton" <whwalton@hotmail.com>
Subject: How to load\save blobs with DBWeb
Newsgroups: borland.public.delphi.database.bdp
User-Agent: XanaNews/1.18.1.6
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 80.195.224.23
Message-ID: <45cae5f7@newsgroups.borland.com>
Date: 8 Feb 2007 00:57:27 -0800
X-Trace: newsgroups.borland.com 1170925047 80.195.224.23 (8 Feb 2007 00:57:27 -0800)
Lines: 50
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail