Gossamer Forum
Home : Products : DBMan : Installation :

Multiple D'Bases give strange results

Quote Reply
Multiple D'Bases give strange results
Hi,
I've been running a single DB with DBMan for a while with no problems. Now that I'm trying to run two databases however i'm running into strange problems. I've put the second db in a seperate folder to keep things organised. The password file is in yet another folder that is shared for both. When I go to look a the new db however, it is as though it is inheriting some of the settings of the .cfg file of the first database. Have a look at the error below, and compare the fields in the error message (the correct ones) to the fields that it is asking for(fields from original database). Any ideas? It's driving me batty.

Thanks in advance



Events Book: Error! Unable to Modify Record.

Error: Unable to Modify Record

There were problems modifying the record:
Brief_Description (Can not be left blank)
Place (Can not be left blank)
Date (Can not be left blank)
Time (Can not be left blank)
Full_Description (Can not be left blank)

Please fix any errors and submit the record again.

FirstName:
LastName:
Email:
HomeNumber:
WorkNumber:
Mobile:
CurrentJob:




| Help | Add | Search | List All | Delete | Modify | Admin | Log Off |


Quote Reply
Re: Multiple D'Bases give strange results In reply to
I think you would have better luck if you put everything into one directory and just renamed the .cfg, .db and html.pl files.

It looks like an appropriate name for your new database would be user. Rename the files for the second database to
user.cfg
user.db
user_html.pl

(you probably don't need a .count file for the second database, although you might want a separate .log file, if you're logging actions).

You can even have a separate .pass file and auth directory if you don't want users to be logged in to both databases at once.

This is how I would set it up.

<cgi-bin>
..<dbman>
....<auth> <- for your first database
....<userauth> <-for your second database
....db.cgi
....default.cfg
....default.count
....default.db
....default.log
....default.pass
....html.pl
....user.cfg
....user.count <- if needed
....user.db
....userhtml.pl
....user.log <- if needed
....user.pass

Set up your user.cfg file as follows:

Code:
# URL of the directory dbman resides in. No Trailing Slash Please.
$db_dir_url = "http://server/cgi-bin/dbman";
# same as in default.cfg

# URL of dbman.
$db_script_url = $db_dir_url . "/db.cgi";
# same as in default.cfg

# Full Path and File name of the database file.
$db_file_name = $db_script_path . "/user.db";
# Full path and file name of the counter file.
$db_id_file_name = $db_script_path . "/user.count";
# Full path and file name of the authorization directory.
$auth_dir = $db_script_path . "/userauth";
# Full path and file name of the password file.
$auth_pw_file = $db_script_path . "/user.pass";
# Full path and file name of the log file.
$auth_log_file = $db_script_path . "/user.log";
# Full path and file name of the html routines.
require $db_script_path . "/userhtml.pl";

When you want to log in to your first database, use

http://server/cgi-bin/dbman/db.cgi

When you want to log in to your second database, use

http://server/cgi-bin/dbman/db.cgi?db=user

Sometimes it doesn't help to be neat. Smile

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






Quote Reply
Re: Multiple D'Bases give strange results In reply to
Hmmmm. This is very odd. Have you made any modifications to the db.cgi script?

I think I had things turned around. You are getting the form from the default database, even when you're in the events database. Is that right?

I see that you have written your own form in the html.pl file. Did you remember to change sub html_record_form in the events_html.pl file?

Try setting

$db_auto_generate = 1;

in your events.cfg file and see what happens.


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






Quote Reply
Re: Multiple D'Bases give strange results In reply to
Thanks for the idea of putting in same dir - I tried it but same problem. I'd already done the name change of the second db. Here's the relevent section of the events.cfg file

# File and URL's
# --------------------------------------------------------
# URL of the directory dbman resides in. No Trailing Slash Please.
$db_dir_url = "http://www.sydney.net/ics/cgi-bin/address";
# URL of dbman.
$db_script_url = $db_dir_url . "/db.cgi";
# Full Path and File name of the database file.
$db_file_name = $db_script_path . "/events.db";
# Full path and file name of the counter file.
$db_id_file_name = $db_script_path . "/events.count";
# Full path and file name of the authorization directory.
$auth_dir = $db_script_path . "/auth";
# Full path and file name of the password file.
$auth_pw_file = $db_script_path . "./common/default.pass";
# Full path and file name of the log file.
$auth_log_file = $db_script_path . "/events.log";
# Full path and file name of the html routines.
require $db_script_path . "/events_html.pl";

Surely that fact that I'm using the same .pass file isn't causing problems?

Any ideas are much welcomed.
Quote Reply
Re: Multiple D'Bases give strange results In reply to
Thanks for the idea of putting in same dir - I tried it but same problem. I'd already done the name change of the second db. Here's the relevent section of the events.cfg file

# File and URL's
# --------------------------------------------------------
# URL of the directory dbman resides in. No Trailing Slash Please.
$db_dir_url = "http://www.sydney.net/ics/cgi-bin/address";
# URL of dbman.
$db_script_url = $db_dir_url . "/db.cgi";
# Full Path and File name of the database file.
$db_file_name = $db_script_path . "/events.db";
# Full path and file name of the counter file.
$db_id_file_name = $db_script_path . "/events.count";
# Full path and file name of the authorization directory.
$auth_dir = $db_script_path . "/auth";
# Full path and file name of the password file.
$auth_pw_file = $db_script_path . "./common/default.pass";
# Full path and file name of the log file.
$auth_log_file = $db_script_path . "/events.log";
# Full path and file name of the html routines.
require $db_script_path . "/events_html.pl";

Surely that fact that I'm using the same .pass file isn't causing problems?

Any ideas are much welcomed.
Quote Reply
Re: Multiple D'Bases give strange results In reply to
I went to your database and tried to sign up for an account. I got a message that it was unable to open default.pass because permission was denied.

I really think you should put everything in one directory. You can keep the same .pass file and auth directory. (I thought you wanted separate ones, from what you said before.)



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






Quote Reply
Re: Multiple D'Bases give strange results In reply to
Sorry about that - I must have been playing around when you went in. Just thought that I'd give extra info if it helps.

Please feel free to go and have a play around

Thanks

Obelix

The directory is as follows
<cgi-bin>
..<address>
....<auth>
....<userauth>
....db.cgi
....default.cfg
....default.count
....default.db
....default.log
....default.pass
....html.pl
....events.cfg
....events.count <- if needed
....events.db
....events_html.pl
....events.log <- if needed
....events.pass

the relevent section of default.cfg is
# File and URL's
# --------------------------------------------------------
# URL of the directory dbman resides in. No Trailing Slash Please.
$db_dir_url = "http://www.sydney.net/ics/cgi-bin/address";
# URL of dbman.
$db_script_url = $db_dir_url . "/db.cgi";
# Full Path and File name of the database file.
$db_file_name = $db_script_path . "/default.db";
# Full path and file name of the counter file.
$db_id_file_name = $db_script_path . "/default.count";
# Full path and file name of the authorization directory.
$auth_dir = $db_script_path . "/auth";
# Full path and file name of the password file.
$auth_pw_file = $db_script_path . "/default.pass";
# Full path and file name of the log file.
$auth_log_file = $db_script_path . "/default.log";
# Full path and file name of the html routines.
require $db_script_path . "/html.pl";


and the relevant section of events.cfg is

# File and URL's
# --------------------------------------------------------
# URL of the directory dbman resides in. No Trailing Slash Please.
$db_dir_url = "http://www.sydney.net/ics/cgi-bin/address";
# URL of dbman.
$db_script_url = $db_dir_url . "/db.cgi";
# Full Path and File name of the database file.
$db_file_name = $db_script_path . "/events.db";
# Full path and file name of the counter file.
$db_id_file_name = $db_script_path . "/events.count";
# Full path and file name of the authorization directory.
$auth_dir = $db_script_path . "/auth";
# Full path and file name of the password file.
$auth_pw_file = $db_script_path . "/default.pass";
# Full path and file name of the log file.
$auth_log_file = $db_script_path . "/events.log";
# Full path and file name of the html routines.
require $db_script_path . "/events_html.pl";


The first database default.db work a charm. The events.db still seems to have a mix of default.db and events.db.

The system is running perl 5.00402
Quote Reply
Re: Multiple D'Bases give strange results In reply to
Of course! How stupid I feel now! I did forget to modify the sub_html_records section in the perl script.

Thanks heaps for you help - the quick service is a credit to you and your company.
Quote Reply
Re: Multiple D'Bases give strange results In reply to
Thanks for the compliment, but I do need to clarify. Gossamer Threads isn't my company. I'm just a user who knows something about the script and I like to hang out here.

I've done things like that before. We all have. I'm just glad you got it to work.


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