Gossamer Forum
Home : Products : DBMan : Discussions :

Can't add or Delete records

Quote Reply
Can't add or Delete records
My Database has been working fine until recently. Now I Can't add or delete records. I checked all the permissions and they seem to be correct. It all seems to stem from the format errors that appear internally.

For example, here is the error message I get when I try to delete one of the records with format errors:
The records with the following keys were not found in the database.


When I try to add a record I d not get an error message. It lets me go through the whole process of adding the record, then when I submit it for posting, the verification page is completely blank. When I log out to view the record, it has not been added. Any help would be great. Thank you.
Quote Reply
Re: [destiny] Can't add or Delete records In reply to
How big is your db file? If your db file is approaching 1 megabyte it may start misbehaving. Open your db file in something like Excel and see if you have any columns out of whack. Sounds like you have some corrupted records that have caused your index to get off.

Also, did you add any extra fields to your default.cfg file? If so you have to add extra places to all of the existing records too.
Quote Reply
Re: [Watts] Can't add or Delete records In reply to
Thanks for helping out. The db file appears to be only about 53k. Someone else set it up several months ago and I have not added or modified anything. With Excel do I have to save it as a different type of file because it won't open a db file. I am a novice when it comes to the database and scripting stuff.

Again thanks.

Last edited by:

destiny: Aug 28, 2003, 10:57 AM
Quote Reply
Re: [destiny] Can't add or Delete records In reply to
I open up database files in excel all the time to check them over. Where it would show the filename just put *.db so it shows your .db files.

When it asks you for data type choose delimited and then in the next screen which appears choose "other" and put in the pipe symbol. The file should then display correctly in excel.

I would suggest making the actual changes in another file and only use excel to check it over for any fields which may be out of place.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Can't add or Delete records In reply to
Excel won't let me open it. When I try to open the database I get the following pop error message: 'The Microsoft Jet database engine could not find the object "mydatabase". Make sure the object exists and that you spell its name and the path correctly.'

I can open it in Wordpad.

Any Suggestions?
Quote Reply
Re: [destiny] Can't add or Delete records In reply to
You stated: "mydatabase"

shouldn't it be mydatabase.db

I should think it would have to have a file extension to be able to open it. You could also make a copy and name it mydatabase.txt and try that.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Can't add or Delete records In reply to
The error message just stated 'mydatabase' with no extention. I found it strange too.

I did open it up as a text file in Excel and I found one entry where just about all the columns are off. Would this affect different users from adding or deleting? Can I go ahead and just delete this entry using something like WordPad or Notepad?
Quote Reply
Re: [destiny] Can't add or Delete records In reply to
Yes, you can just delete the record or make note of what pipes are missing and add them manually.

One record can corrupt the whole database and cause it to not work properly. I have found that by removing trailing and leading spaces in fields there is less chance of problems with corruption.

In your db.cgi file within sub parse_form

after:

$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

add:

$value =~ s/^\s+//g; # Trim leading blanks
$value =~ s/\s+$//g; # Trim trailing blanks

Hopefully this will prevent problems in the future.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/