Gossamer Forum
Home : Products : DBMan : Customization :

Changing Fields

Quote Reply
Changing Fields
Hey guys,

I've installed the demo of DBMan, and so far everything looks great...however, I'm having a lot of trouble modifying the fields...I'm doing this to try to match the DBMan fields up with the ones I have in my Access 97 database, so I can import the Access DB into DBMan...

Once I get past the hurdle of changing the fields, I would imagine the next step would be to export the Access DB into a text format...but how would I then import that into DBMan?

Thanks for putting up with my lack of knowledge Smile

Chris
Quote Reply
Re: Changing Fields In reply to
What sort of problem are you having with modifying the field definitions?


------------------
JPD





Quote Reply
Re: Changing Fields In reply to
JP,

This is the part of the file...

"# Database Definition
# --------------------------------------------------------
# Definition of your database. Format is
# field_name => ['position', 'field_type', 'form-length', 'maxlength', 'not_null', 'default', 'valid_expr']

%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 255, 1, '', ''],
URL => [2, 'alpha', 40, 255, 1, 'http://', '^http://'],
Type => [3, 'alpha', 0, 60, 1, '', ''],
Date => [4, 'date', 12, 15, 1, &get_date, ''],
Category => [5, 'alpha', 0, 255, 1, '', ''],
Description => [6, 'alpha', '40x3', 500, 0, '', ''],
Validated => [7, 'alpha', 0, 3, 1, 'Yes', 'Yes|No'],
Popular => [8, 'alpha', 0, 3, 0, '', ''],
Userid => [9, 'alpha', -2, 15, 0, '', '']
);"

I try to change things like "Title" to "Name" or "URL" to "Website"...all I do is change that text...but I don't see those changes take affect in DBMan...

Also, even before I changed a thing, when I go to "Search" (I renamed it Search instead of "View"), I get this message next to the "Popular" field -

"error building checkboxes: no checkboxes specified in config for field 'Popular'"

Chris

Quote Reply
Re: Changing Fields In reply to
One thing to remember when exporting an "external" database (from Access) is that you have the NULL fields (| |) set-up so that the fields in Access match the fields you are creating in DBMAN.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Changing Fields In reply to
Eliot,

Null fields? I'm not familiar with those...I understand that the fields need to matchup to export smoothly...are you saying that any fields that are in one database, but not in the other, need to be null to avoid problems?

Chris
Quote Reply
Re: Changing Fields In reply to
JP,

Something interesting...I told you above how I changed the field names of Title and URL to Name and Website...well the changes didn't take affect on the form, however when I tried to Add a record...I got this message...

"There were problems with the following fields:
Name (Can not be left blank)
Website (Can not be left blank)
Please fix any errors and submit the record again
"

Chris
Quote Reply
Re: Changing Fields In reply to
I would suggest you don't even think about exporting an Access file until you have the other things worked out. One thing at a time.

The reason your changes don't show up is that you haven't changed the code for the forms and displays. You either need to edit the html.pl file or you need to set

$db_auto_generate = 1;

in the default.cfg file.

I would suggest the latter at this point. Then check to see if your fields show up.


------------------
JPD





Quote Reply
Re: Changing Fields In reply to
JP,

Ok, good idea, I'll hold off on Access for now.

Wow, the fields showed up! I'm impressed Smile Thanks a lot! Smile Does this mean that I can change the names of the other fields without a problem?

Also, the Popular field has the message "error building checkboxes: no checkboxes specified in config for field 'Popular'"

Thanks,
Chris
Quote Reply
Re: Changing Fields In reply to
Yep. You can change, add, delete, whatever any fields you want to. As long as you have $db_auto_generate = 1; they will show up as you have defined them in your .cfg file.

Regarding the "Popular" checkbox -- I'm not sure what's going on. Do you have a "Popular" field? Is there a definition for it in %db_checkbox_fields?

Please read all of the .cfg file carefully. You'll find lots of good info there.

And don't go any further with developing your database until you know for sure everything works as it is supposed to. Add, delete, modify, search for records -- multiple records. Really run it through its paces and make sure your field definitions are correct before you do anything else.


------------------
JPD





Quote Reply
Re: Changing Fields In reply to
JP,

I'm SO thankful! This is really an amazing program!

Oh, and about Popular and Validate...I'd pretty much like to get rid of them alltogether...should I just erase them from default.cfg? I thought I should ask first because I'm not sure what Validate's purpose is.

Chris
Quote Reply
Re: Changing Fields In reply to
Hi,

Just noticed something incredibly odd!

Whatever I type into the "Description" field ends up in the "Name" field...whatever I type into the "Website" field ends up in the "ID" field...If I choose "Yes" on validate, than that shows up in the "Date" field, etc...whatever info I enter when I add a new record is shown in the wrong place when I view the record through a search..

Chris
Quote Reply
Re: Changing Fields In reply to
None of the default fields have any particular purpose. You can delete any of them that you want.

If you change the fields, you do have to start over with a blank database. The default.db file that came with the distribution is set up to match the fields that are in the distribution .cfg file.

Just open up default.db and delete everything in it and upload the empty file. Then add some records.

Be aware that any time you change the number of fields in you database definition, your database will not reflect the changes. You'll probably have to start over with a blank .db file every time. It's best to make sure you have your field definitions correct from the start.


------------------
JPD





Quote Reply
Re: Changing Fields In reply to
JP,

Thanks...that works perfectly! I really want to thank you for all your incredible help...it's been very useful Smile

Chris
Quote Reply
Re: Changing Fields In reply to
TWTCommish,

NULL fields are "blanks" in particular fields, but it shows up in DBMAN (and flat files) as two | characters next to each other. If you do use Access, you will need to specify that if there are no values in a particular field that there should be a | character.

See, we have a data manager at the College who is producing the database file via Object Access (different from MS Access). The major problem we've experienced is that he has neglected to insert the "blank" or null fields in his database file. When the file is uploaded to the server and we search the file via DBMAN, the fields are all screwed up. We fixed this problem by having him export the flat file with NULL fields. Works perfectly now.

Regards,


------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Changing Fields In reply to
Eliot,

Thanks a lot, I'll give it a try! Smile

Chris