Recent

Author Topic: What is the field length of memo in DBF Visual DBase VII?  (Read 4664 times)

Raf20076

  • Full Member
  • ***
  • Posts: 173
    • https://github.com/Raf20076
What is the field length of memo in DBF Visual DBase VII?
« on: February 08, 2016, 09:30:47 pm »
Hi guys

I am creating DBF database using Visual DBase VII - I use MyDbf Studio (Open source for DBF) and I must input field lenght in memo. If I left it empty it says that I must input the lenght? Have you got any ideas? What is the value for memo in Visual DBase VII?

Visual DBase VII has got field's types like string, integer etcno problem with that but problem with memo, blob.

Thanks

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: What is the field length of memo in DBF Visual DBase VII?
« Reply #1 on: February 08, 2016, 10:10:26 pm »
usually it is the size of data that will be saved inside the table file before it spawns an external memo file. Do not set it to high or the table file will get big for no reason.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Raf20076

  • Full Member
  • ***
  • Posts: 173
    • https://github.com/Raf20076
Re: What is the field length of memo in DBF Visual DBase VII?
« Reply #2 on: February 09, 2016, 08:15:17 am »
usually it is the size of data that will be saved inside the table file before it spawns an external memo file. Do not set it to high or the table file will get big for no reason.
Could you please give me an example? I am confused what value should I enter. Thank you

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: What is the field length of memo in DBF Visual DBase VII?
« Reply #3 on: February 09, 2016, 12:24:27 pm »
usually it is the size of data that will be saved inside the table file before it spawns an external memo file. Do not set it to high or the table file will get big for no reason.
Could you please give me an example? I am confused what value should I enter. Thank you

Can you first explain the use of dBase? And Why? It is merely legacy. But if needed I can probably help.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: What is the field length of memo in DBF Visual DBase VII?
« Reply #4 on: February 09, 2016, 01:11:49 pm »
usually it is the size of data that will be saved inside the table file before it spawns an external memo file. Do not set it to high or the table file will get big for no reason.
Could you please give me an example? I am confused what value should I enter. Thank you
Do you have any statistics on the length of the memo field? What is the minimum size, what is the maximum how many records have data in there? Keep in mind that DBase has a static field size, it does not support what is know as a "varchar" on modern databases. If 80% of your fields are empty then a size of 40 in a 1000 record table will waste 32.000 bytes in the file. If your minimum size of the field is 40 with more than 80% of the records have at least 40 chars and the rest are empty then a size of 40 will make the data retrieval faster for most records and it will only waste 8.000 bytes on a 1000 record database. It is that balance that you need to find. In all cases the memo field will accept up to 32K bytes of data if memory serves me right.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Raf20076

  • Full Member
  • ***
  • Posts: 173
    • https://github.com/Raf20076
Re: What is the field length of memo in DBF Visual DBase VII?
« Reply #5 on: February 09, 2016, 01:52:04 pm »
Hi guys
I am not expert in programming I am rather hobbyist (I like programming) so my knowledge comes from mostly Internet, some books etc. and I found that Object Pascal is quite easy to understand I started C++ but it didn't appeal to me. When it comes to database and memo field I use My DBF Studio to create database. I know that I can use code or some options in Lazarus Ide itself, but I found difficult to use memo, no problem with strings, intefer, DataTime etc
I attach photo of MyDBF Studio and how I create a table to give you an idea what I mean.

I want to use memo for taking notes - so the size I think should be unlimited, and string for title of the note, simple notetaking application for myself.

Thanks a lot for pointing me some ideas.

 

Raf20076

  • Full Member
  • ***
  • Posts: 173
    • https://github.com/Raf20076
Re: What is the field length of memo in DBF Visual DBase VII?
« Reply #6 on: February 09, 2016, 08:44:06 pm »
Hi guys I sorted out my problem ;) ;D and this solution could be very helpful for people who has just started to use dbf etc (as myself)

1. From Data access we put component DBF on Form1
2. In Object inspector click Dbf1:TDbf and then see Properties

Table Name - write down - base.dbf
Table Level - write down - 7
StoreDefs - choose - True
OpenMode - omAutoCreate
FilePath - choose - Desktop
FieldDefs - click it - Editing Dbf1.FieldsDefs windows appears - click Add

in Object Inspector

select 0-Dbf1Field1:TfieldDef and in its properties

DataType - choose - ftString
Name - Field1
Size - 30

Then in Editing Dbf1.FieldsDefs windows - click Add again

select 1-Dbf1Field2:TfieldDef and in its properties

DataType - choose - ftMemo
Name - Field2
Size - 10

Close Editing Dbf1.FieldsDefs windows

in object Inspector select Indexes: TDbfIndexDefs and click right button of the mouse there will menu click Add Item

In Object Inspector select 0-TDbfIndexDef:TDbfIndexDef

In its properties
IndexFile - write down - indexs.ndx
in Options
ixCaseInsesentive - choose - True
ixPrimary - choose - True
SortField - Field1

then in Object Inspector select Dbf1: TDbf and in its properties
Active - choose -True

on your desktop you will have three database files
Indexs.ndx - index file
base.dbf - database
base.dbt - DBT is a file extension for a text memo file format used by dBase

Now you can use your database files in your application

All the best

 

TinyPortal © 2005-2018