Storing AUTOCAD-FILES in Progress?

sidero

New Member
Hi all!

I would like to store AUTOCAD-Files in a progress table.
Can anyone give me some tips on how to do this?
The Files are larger than 64K.

Thanks in advance
Oliver
Sidero EDV-GmbH, Austria
 

sidero

New Member
Special notice to the above thread

actually I would like to copy the AUTOCAD-drawing from the Windows-Clipboard into a Progress-Table.

Oliver
Sidero EDV-GmbH
 

sidero

New Member
Special notice to the above thread

Also... how can I display the AUTOCAD drawing in Progress?

Oliver
SIDERO EDV-GmbH
 
See routines below for storing large files in DB.

Displaying etc use and OCX.


/***************************************************************************************
**
** P R O C E D U R E
** -----------------
**
** File: draw/general/impimg.p
**
** Author: Chris Paulson
**
** Date: 6-Sep-01
**
** Description: Import an image into a temp table
**
** Mod history:
**
***************************************************************************************/

/************************************* Parameters *************************************/
{draw/include/imgtbl.i}

define input param chrFileName as character no-undo.
define input param pImageName as char no-undo.
define output param table for images.
/************************************* Scope Defines **********************************/
/************************************* Includes ***************************************/
/************************************* Shared *****************************************/
/************************************* Vars *******************************************/
define variable rawImageData as raw no-undo.
define variable intSequence as integer no-undo initial 1.
/************************************* Main *******************************************/
run general/wait.p.
/*
** Max size that can be stored in a record
*/
length(rawImageData) = 16384.

input from value(chrFileName) binary no-map no-convert.

repeat:
import unformatted rawImageData.
create images.
assign images.ImageName = pImageName
images.ImageSequence = intSequence
images.ImageData = rawImageData
intSequence = intSequence + 1.
END.

input close.

run general/nowait.p.

/************************************* End File ***************************************/






/***************************************************************************************
**
** P R O C E D U R E
** -----------------
**
** File: draw/general/expimg.p
**
** Author: Chris Paulson
**
** Date: 6-Sep-01
**
** Description: Export an image from a temp table
**
** Mod history:
**
***************************************************************************************/

/************************************* Parameters *************************************/
{draw/include/imgtbl.i}

define input param chrFileName as character no-undo.
define input param pImageName as char no-undo.
define input param table for images.
/************************************* Scope Defines **********************************/
/************************************* Includes ***************************************/
/************************************* Shared *****************************************/
/************************************* Vars *******************************************/
/************************************* Widgets ****************************************/
/************************************* Frame ******************************************/
/************************************* Triggers****************************************/
/************************************* Main *******************************************/
run general/wait.p.

output to value(chrFileName) no-map no-convert binary.

for each images no-lock where images.ImageName = pImageName:
put control images.ImageData.
end.

output close.
run general/nowait.p.


/************************************* End File ***************************************/
 

tdi

Progress Fan
Check this out

i've used this in my app, and works good. i've stored form txt to video!!.

---------------------------------------------------------------------
How to Implement BLOB Support in a Progress Database (8.2+)

INTRODUCTION:
=============
This knowledgebase entry describes how to store and retrieve binary
data in a Progress database.

This information only applies to Progress versions 8.2A and higher.


WHY YOU NEED TO KNOW THIS:
==========================
You need to know this if you have the need to store and retrieve
binary data from a Progress database (obviously).


CODE ASSUMPTIONS:
=================
In the following code examples I am making the following
assumptions:

- Only bitmaps (*.BMP) will be stored in the database.

- The bitmaps will be broken out into 16K (16,384 byte) chunks.

- A bitmap will be added to the database by clicking on a push
button and selecting a bitmap from the standard MS-Windows
file open dialog box.

- A bitmap will be retrieved and displayed by clicking on a row in
a browse widget (i.e. the VALUE-CHANGED event).

- There are only three (3) widgets on the window. They are as
follows:

1) A push button which is used to add a bitmap to the database.

2) A browse widget which displays a list of available bitmaps
which are stored in the database and by which the user can
select an image to be retrieved and displayed.

3) An image widget which is used to display the retrieved bitmaps.

- The widgets are named as follows:

1) PBN-AddBitmap /* push button used to add bitmap */

2) BRW-AvailableBitmaps /* browse listing available bitmaps */

3) IMG-Display /* image widget that displays bitmap */


DATABASE STRUCTURE:
===================
The database is made up of the following fields:

- ImageName CHARACTER, FORMAT "X(60)"
- ImageSequence INTEGER
- ImageData RAW

I also have an index defined containing ImageName and ImageSequence
as fields in the index. The index is defined as unique and primary.


CODE TO STORE A BITMAP IN THE DATABASE:
=======================================
ON CHOOSE OF PBN-AddBitmap IN FRAME {&FRAME-NAME}
DO:
DEFINE VARIABLE chrFileName AS CHARACTER NO-UNDO.
DEFINE VARIABLE logResult AS LOGICAL NO-UNDO.
DEFINE VARIABLE rawImageData AS RAW NO-UNDO.
DEFINE VARIABLE intSequence AS INTEGER NO-UNDO INITIAL 1.

SYSTEM-DIALOG GET-FILE chrFileName
TITLE "Please Select a Bitmap to Add to the Database"
FILTERS "Bitmap Files (*.bmp)" "*.bmp"
MUST-EXIST RETURN-TO-START-DIR UPDATE logResult.

IF logResult = False THEN
RETURN NO-APPLY.

ASSIGN logResult = SESSION:SET-WAIT-STATE("GENERAL")
LENGTH(rawImageData) = 16384.

INPUT FROM VALUE(chrFileName) BINARY NO-MAP NO-CONVERT.

REPEAT:
IMPORT UNFORMATTED rawImageData.
CREATE IMAGES.
ASSIGN IMAGES.ImageName = chrFileName
IMAGES.ImageSequence = intSequence
IMAGES.ImageData = rawImageData
intSequence = intSequence + 1.
END.

INPUT CLOSE.

ASSIGN logResult = SESSION:SET-WAIT-STATE("").

OPEN QUERY BRW-AvailableBitmaps
FOR EACH IMAGES
WHERE IMAGES.IMAGE-SEQUENCE = 1 NO-LOCK.
END.


CODE TO RETRIEVE A BITMAP FROM THE DATABASE:
============================================
ON VALUE-CHANGED OF BRW-AvailableBitmaps IN FRAME {&FRAME-NAME}
DO:
DEFINE VARIABLE chrImageName AS CHARACTER NO-UNDO.
DEFINE VARIABLE logResult AS LOGICAL NO-UNDO.

ASSIGN logResult = SESSION:SET-WAIT-STATE("GENERAL")
chrImageName = IMAGES.ImageName.

OUTPUT TO C:\TEMPBLOB.BMP NO-MAP NO-CONVERT BINARY.

FOR EACH IMAGE NO-LOCK WHERE IMAGE.ImageName = chrImageName:
PUT CONTROL IMAGE.ImageData.
END.

OUTPUT CLOSE.

ASSIGN logResult = SESSION:SET-WAIT-STATE("")
logResult = IMG-Display:LOAD-IMAGE("")
logResult = IMG-Display:LOAD-IMAGE("C:\TEMPBLOB.BMP").
END.

Progress Software Technical Support Note # 17093
 
Top