[comp.os.msdos.apps] dBase-III+ memo fields.

basil@thyme.jpl.nasa.gov (Basil Hashem) (05/24/91)

I have a database with a field of type memo and I'm trying to replace some
values in certain records.  What I want to do is something like the following:

REPLACE ALL MY_MEMO with "New text" FOR <condition>

Unfortunately, dBase barks back with a "Data type mismatch." error, can anyone
suggest a way around this problem.  

I know better not to use memo fields, but since I've inherited this database 
I'm stuck with these fields.  I'd be more than happy to replace the memo
fields with a character type field, if only I knew how.

Thanks for any help you can provide,

-- 
                                 Basil Hashem
                             basil@thyme.jpl.nasa.gov
            Jet Propulsion Laboratory     La Canada Flintridge, CA

jmann@vineland.pubs.stratus.com (Jim Mann) (05/24/91)

In article <1991May23.172337.28628@thyme.jpl.nasa.gov> basil@thyme.jpl.nasa.gov  
(Basil Hashem) writes:
> 
> I have a database with a field of type memo and I'm trying to replace some
> values in certain records.  What I want to do is something like the  
following:
> 
> REPLACE ALL MY_MEMO with "New text" FOR <condition>
> 
> Unfortunately, dBase barks back with a "Data type mismatch." error, can  
anyone
> suggest a way around this problem.  

Unfortunately, you may be stuck. There seems to be no way to access dBase
memo fields other than manually. You can't even get at them in a program.
It's a major pain, and why most people try to avoid them unless they
have no way around it. (Unfortunately, there is often no way around it.)

Jim Mann                                      jmann@vineland.pubs.stratus.com 
Stratus Computer

   Not since Cromwell's troops, their puritan sensibilities offended by beauty, 
   went around smashing decorative art in churches has there been an act 
   of folly  comparable  to the abandonment and destruction of Forbes Field, 
   the Pirates' home for generations.   
                            --  George F. Will, from Men at Work: The Craft of  
Baseball

basil@thyme.jpl.nasa.gov (Basil Hashem) (05/24/91)

In article <1991May23.172337.28628@thyme.jpl.nasa.gov> I wrote:
= 
= I have a database with a field of type memo and I'm trying to replace some
= values in certain records.  What I want to do is something like the following:
= 
= REPLACE ALL MY_MEMO with "New text" FOR <condition>
= 
= Unfortunately, dBase barks back with a "Data type mismatch." error, can anyone
= suggest a way around this problem.  
= 
Not only that, it appears that when using memo fields, the associated file
(.DBT) tends to grow uncontrollably.  My file has now reach 600,000 bytes!
yikes!  Anyone know how to compact that space?  Or better yet get the fields
into a character format.

I need help.
-- 
                                 Basil Hashem
                             basil@thyme.jpl.nasa.gov
            Jet Propulsion Laboratory     La Canada Flintridge, CA

msdos1@funet.fi (Petri Hartoma - Tut) (05/27/91)

In article <1991May23.225344.18772@thyme.jpl.nasa.gov> basil@thyme.jpl.nasa.gov (Basil Hashem) writes:
> Not only that, it appears that when using memo fields, the associated file
> (.DBT) tends to grow uncontrollably.  My file has now reach 600,000 bytes!
> yikes!  Anyone know how to compact that space?  Or better yet get the fields
> into a character format.

There are some PD/SW programs to do that, but the easiest way of
reducing the memo file is to copy the database to another name:

copy database to temp
eras database.dbf
eras database.dbt
ren temp.dbf database.dbf
ren temp.dbt database.dbt

This works at least with Clipper's DBU utility. ;-)

&& Petri

par@hq.af.mil (Paul A. Reitelbach) (05/29/91)

   In article <1991May23.172337.28628@thyme.jpl.nasa.gov> I wrote:
   = 
   = I have a database with a field of type memo and I'm trying to replace some
   = values in certain records.  What I want to do is something like the following:
   = 
   = REPLACE ALL MY_MEMO with "New text" FOR <condition>
   = 
   = Unfortunately, dBase barks back with a "Data type mismatch." error, can anyone
   = suggest a way around this problem.  
   = 
   Not only that, it appears that when using memo fields, the associated file
   (.DBT) tends to grow uncontrollably.  My file has now reach 600,000 bytes!
   yikes!  Anyone know how to compact that space?  Or better yet get the fields
   into a character format.

   I need help.
   -- 
				    Basil Hashem
				basil@thyme.jpl.nasa.gov
	       Jet Propulsion Laboratory     La Canada Flintridge, CA

Yes, you can shrink the memo field in a database by simply coping it (i.e. use
the copy file command) Copy the old file to a new file and then delete the old
file then rename the new file to the old file name.  This will shrink the file
greatly as you will see.  I would not be suprised if you see that 600,000 byte
file of yours go down to 200,000 bytes or less.  Good luck, send e-mail if you
have more questions?

--
Paul A. Reitelbach                  *   There's a way to do it better - 
Computer Programmer/Analyst         *   find it.
United States Air Force Civilian    * 
Pentagon, Washington, D.C.          *      Thomas A. Edison (1847 - 1931)