Board index » delphi » ADO & MS SQL basics

ADO & MS SQL basics

Any pointers or suggestions on the following questions are much appreciated.

1) What is the best way to allow a user to edit a subset of data? I'm using
InfoPower. Also, datasets are returned by stored procedures. What components
and options should I set so that the data is shown in the grid, the user can
edit the data, then the updated records can be sent back to the server?

2) I have MS image fields in my database that hold JPG and Word DOC files. I
know how to write these data values, but how do I retrieve them? For
example, with JPGs, how do I read from MS SQL and place in a TImage? Also,
with Word files, do I need to save the BLOB to a temp file first, then open
in Word, or can I use some sort of in-memory file so that Word can open
faster?

Thanks in advance.

 

Re:ADO & MS SQL basics


1) As the data is returned by a stored procedure it is effectively readonly.
So you can only update using insert/update statements. This is actually
quite easy if you used cached updates, and then cycle thru your
dataset(first, next) and process accordingly.

2) I've always saved/extracted to a temporary file first. Same with JPG's.
Then you can load from file.

--
Adroit Software Ltd
------------------------------
Remove the nospam. to mail me direct

Quote
"Keith Marbach" <kmarb...@zunna.com> wrote in message

news:3b93cc23_2@dnews...
Quote
> Any pointers or suggestions on the following questions are much
appreciated.

> 1) What is the best way to allow a user to edit a subset of data? I'm
using
> InfoPower. Also, datasets are returned by stored procedures. What
components
> and options should I set so that the data is shown in the grid, the user
can
> edit the data, then the updated records can be sent back to the server?

> 2) I have MS image fields in my database that hold JPG and Word DOC files.
I
> know how to write these data values, but how do I retrieve them? For
> example, with JPGs, how do I read from MS SQL and place in a TImage? Also,
> with Word files, do I need to save the BLOB to a temp file first, then
open
> in Word, or can I use some sort of in-memory file so that Word can open
> faster?

> Thanks in advance.

Re:ADO & MS SQL basics


I am new to ADO and SQL Server, so your help is much appreciated.

One thing I have found, using SQL2K, D6, InfoPower3000, ADO, when I have a
stored procedure that returns a simple dataset (from a single table only,
like select * from customer), the dataset can be edited. In fact, I can edit
in the IP grid, and when I move up or down to a new record the updated
record is posted to the server.

I guess my question becomes, how do you make a dataset readonly? What I
really need to understand, and don't, are all the options relating to cursor
location, isolation level, cursor type, etc.

Quote
"Brian Jones" <bri...@nospam.adroit-software.co.uk> wrote in message

news:3b94c0b1_1@dnews...
Quote
> 1) As the data is returned by a stored procedure it is effectively
readonly.
> So you can only update using insert/update statements. This is actually
> quite easy if you used cached updates, and then cycle thru your
> dataset(first, next) and process accordingly.

> 2) I've always saved/extracted to a temporary file first. Same with JPG's.
> Then you can load from file.

> --
> Adroit Software Ltd
> ------------------------------
> Remove the nospam. to mail me direct
> "Keith Marbach" <kmarb...@zunna.com> wrote in message
> news:3b93cc23_2@dnews...
> > Any pointers or suggestions on the following questions are much
> appreciated.

> > 1) What is the best way to allow a user to edit a subset of data? I'm
> using
> > InfoPower. Also, datasets are returned by stored procedures. What
> components
> > and options should I set so that the data is shown in the grid, the user
> can
> > edit the data, then the updated records can be sent back to the server?

> > 2) I have MS image fields in my database that hold JPG and Word DOC
files.
> I
> > know how to write these data values, but how do I retrieve them? For
> > example, with JPGs, how do I read from MS SQL and place in a TImage?
Also,
> > with Word files, do I need to save the BLOB to a temp file first, then
> open
> > in Word, or can I use some sort of in-memory file so that Word can open
> > faster?

> > Thanks in advance.

Other Threads