Page 1 of 1

Blank record

PostPosted: Mon Aug 19, 2013 5:58 pm
by BRobinsonS
I seem to end up with a blank record occasionally in a database table.
Recently a record at the top of the table had all blank fields although there was information there originally.
My fear is that I have lost other records without knowing it.
I originally thought I had just inserted a record (blank) by mistake but not in this case.

I have a primary index etc from advice in this forum.

Any thoughts ?

Re: Blank record

PostPosted: Tue Aug 20, 2013 9:32 am
by Neosoft Support
It would be unusual for records to just vanish, but it is possible to create an empty/blank record. For example, dbpSaveRecords will save an empty record to the datebase. Also, if you have fields linked to Text Entry objects, then typing a space into one of the fields will trigger an automatic save.

Re: Blank record

PostPosted: Tue Aug 20, 2013 9:58 am
by BRobinsonS
I will have to review my dbpSaveRecords use.
It occurred to me that I added a field to the table (using my own db app) which may have triggered an empty record.
Again I'll have to look at the code in my db app too.

Re: Blank record

PostPosted: Sat Aug 24, 2013 12:21 pm
by BRobinsonS
Just realized my 'blank record' (first in table index by Name) occurred when I added a new field to the table using my own db Utility.

I do use a dialog box to choose field type(drop-down box) and length of field if Char or String.
Then, dbpAddField "[DatabaseName]" "[TableName]" "[FieldName]" "[FieldTypes]"

Don't know why this would wipe out the contents of the first record (first indexed record) in the table.

Ideas while I look closer at my code?

Re: Blank record

PostPosted: Mon Aug 26, 2013 9:42 am
by Neosoft Support
The only thing I can think of is that the lost record was newly created and hadn't been saved prior to calling dbpAddfield.

Re: Blank record

PostPosted: Mon Aug 26, 2013 10:13 am
by BRobinsonS
The record pre-existed. In fact it is the first record in the table.
After deletion of records while creating the app/table (first field 'id' autoInc primarykey), the first record id autoinc has value of 38.

Certainly is a puzzle.
Perhaps I will try a simple app that would only be used to add a field and see what happens to the table.

Re: Blank record

PostPosted: Mon Aug 26, 2013 11:52 am
by BRobinsonS
Still on the trail of 'blanking out' a record.
I created a simple app to open the database and table in question by button.
Added an 'Add Field' button and 'Close table' button so I could open and close table.

Used Add Field button and field was added. Closed the table and opened it again.
No blank record.

Opened the table in my DB Utility app to work with tables.
Open DB and Table Ok. Closed the DB and then opened again and 'Blank record' showed up again.
This DB has two tables and a blank record (pre-existing) showed up there too.

Can't see opening and closing tables would cause blank record.
So there has to be something in my DB Utility app with regard to opening and closing db/tables .

Thoughts are still welcomed.

Re: Blank record

PostPosted: Mon Aug 26, 2013 2:03 pm
by BRobinsonS
May have found the problem.
I was using a subroutine to populate a ListBox for displaying fields with definitions of a table.
This 'fired up' on opening a table or changing tables.

Blank records is not showing up now. :D
after hours of trying ...

Re: Blank record

PostPosted: Tue Aug 27, 2013 9:41 am
by Neosoft Support
That's interesting. I'm glad that you found a solution.