Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DOC-Group
 DOC In-Box
 .dbs file doc for mod_dbsetup.asp
 Forum Locked
 Printer Friendly
Author  Topic Next Topic  

toddmeck
Starting Member

3 Posts

Posted - 29 March 2002 :  13:10:40  Show Profile
Forgive the Snitz newbie here... but a friend showed me the site yesterday. I downloaded a copy of it and really liked the mod_dbsetup.asp system (among many other things) based on .dbs script files. Anyway, I saw lots of discussion on documents, but forgive me for not being able to find one specifically for the .dbs files. So, I created my own short text file document to help in my own Snitz project which I would like to give back to the community if it can be of any use which you can download from here:
http://www.honorandfaith.org/SnitzDBModOrig.txt

<

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 29 March 2002 :  14:41:37  Show Profile  Visit HuwR's Homepage
Sorry, but your Doc is not correct, it does not support all those types. it only supports int varchar and memo field types.

These are the original specs


Script file Instructions.


The file is formatted into sections, which are delimited with ini file style tags. You should name your file using the following format, dbs_FILENAME.asp, where FILENAME is your setup filename.

The allowed Tags are


[CREATE] - for creating new tables
[ALTER] - for Adding/deleting/changing columns in an existing table
[DELETE] - Deleting records from a Table
[INSERT] - Inserting records into a table
[UPDATE] - Updating specific values
[DROP] - Deleting Tables


Section Formatting.


MyTest Mod The fist line of the file is the name of the Mod the Db setup is for.

[CREATE] Create table sections
TEST_TABLE Name of the Table to create
TABLE_ID Name of the ID Field, leave a blank line if no ID field is required
field1#int#NULL#0 The rest of the lines in this section are for the field definitions
field2#varchar(20)## They should all follow the same Format: FIELDNAME#FIELDTYPE#NULL#DEFAULT
FIELDNAME# Name of column to add
FIELDTYPE# Valid field Types are smallint,int,varchar,text.
NULL# Column allows NULL leave blank for Not allow
DEFAULT default value for new field
Any missing items should be left blank, the '#' delimeters should all appear.
i.e.
field1#int#NULL#0 will create an integer field with a default value of 1 that allows NULL
field2#varchar(20)## will create a varchar field with no default that does not allow NULLs
[END] End of create table tag.


[ALTER] Alter table start tag
TEST_TABLE Name of table to be altered
ADD#field3#int#NULL# Field Definitions - Format: As above
ALTER#field2#varchar(255)## Change column Properties
DROP#field4### Delete a column from the Table
[END] End Alter table tag


[INSERT] Insert Values start Tag
TEST_TABLE Name of table you whish to insert values into
(field1,field2)#(12,'test') Field Defs - This uses the same basic definition as an insert
statement. The first parameter being a comma delimeted list of fields
and the second the corresponding values.Each parameter enclosed by ()
i.e. (field1,....)#(value1,....)
[END] End of Table insert Tag


[UPDATE] Table Update start Tag
TEST_TABLE2 Name of Table to update
field22#'B'#TABLE_ID2 = 1 Field definitions - Format: FIELDNAME#VALUE#WHERE CLAUSE
FIELDNAME# - Name of field to be updated
VALUE# - New value for field
WHERE CLAUSE - Criteria to specify records to be updated, blank if All records
[END] End of update tag


[DROP]
TEST_TABLE
[END]


<
Go to Top of Page

toddmeck
Starting Member

3 Posts

Posted - 29 March 2002 :  17:51:14  Show Profile
Thanks so much for the review and additional information :) I will update my document accordingly and repost a link to it. I had to make a lot of assumptions by reverse engineering a document from just the asp file, so this will help clear things up!

<
Go to Top of Page

Reinsnitz
Snitz Forums Admin

USA
3545 Posts

Posted - 04 November 2003 :  15:22:36  Show Profile  Visit Reinsnitz's Homepage  Send Reinsnitz an AOL message  Send Reinsnitz an ICQ Message  Send Reinsnitz a Yahoo! Message
Along these lines... I have a question...

Using the following script for setting up the User Groups MOD, the first table created uses the strTablePrefix variable for the prefix, and the second one uses the strMemberTablePrefix then the third table goes back and uses the first prefixing variable...

[CREATE]
USERGROUPS
USERGROUP_ID
USERGROUP_NAME#varchar(100)##
USERGROUP_DESC#memo#NULL#
USERGROUP_TYPE#int##0
AUTOJOIN#int##0
MEM_HIDE#int##0
MOD_HIDE#int##0
[END]

[CREATE]
USERGROUP_MEMBERS
USERGROUP_ID#int##
MEMBER_ID#int##
MEMBER_TYPE#int##1
[END]

[CREATE]
ALLOWED_USERGROUPS
USERGROUP_ID#int##
FORUM_ID#int##
PERMS#int##0
[END]

[INSERT]
CONFIG_NEW
(C_VARIABLE,C_VALUE)#('STRUGVIEW','0')
(C_VARIABLE,C_VALUE)#('STRUGMEMVIEW','0')
(C_VARIABLE,C_VALUE)#('STRUGMODFORUMS','0')
[END]


is there a way to tell it which variable to use for the prefix?<

Reinsnitz (Mike)
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 04 November 2003 :  15:43:19  Show Profile  Visit HuwR's Homepage
this is how it was designed, the use of the word MEMBER in the table name causes it to use the membertable prefix<
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 20 January 2004 :  23:18:56  Show Profile
Huw, in the document you posted above, could you add the description for the [DELETE] tag?<
Go to Top of Page

fpgal
New Member

93 Posts

Posted - 31 January 2004 :  22:58:58  Show Profile

Hi, would one of you who actually understands this mind taking a look at this code, please? I'm trying to follow the directions but I keep getting an error. Here's the code in my .dbs file:

[UPDATE]
COLOURS
C_STRHEADCELLBGIMAGE#'banana.gif'#CONFIG_ID = 14
[END]

And here's my error:

Updating Forum Values..
UPDATE FORUM_COLOURS SET C_STRHEADCELLBGIMAGE = 'banana.gif' WHERE CONFIG_ID=14
13 | Type mismatch

Basically, all I'm trying to do is to change the HeadCellBGImage value for one of my colour templates - the one with an auto-generated ID of 14. Any help would be appreciated.


Thanks!

fpgal<

Edited by - fpgal on 31 January 2004 22:59:32
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 01 February 2004 :  06:11:57  Show Profile  Visit HuwR's Homepage
there doesn't appear to be anything wrong with your dbs or the query, are your field names correct ?

<
Go to Top of Page

fpgal
New Member

93 Posts

Posted - 06 February 2004 :  18:12:00  Show Profile

Thanks for responding, Huw. Yes, the field names are correct. I double-checked them in the DB. I also checked and it did actually update the DB despite making that error; so I have no idea what that's about. Very weird.

Also, I know you're very busy, but would you mind terribly adding on the description for the DELETE tag in your directions? And any information on how to delete a specific record using a .dbs file. I'd really appreciate it.

Thanks for your help!

fpgal<
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 06 February 2004 :  18:20:52  Show Profile  Visit HuwR's Homepage

[DELETE]
Tablename
where clause
[END]<
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 07 February 2004 :  15:02:44  Show Profile
For example:

[DELETE]
MEMBERS
M_FIRSTNAME = 'Bob'
[END]

Will delete all rows in the MEMBERS table where M_FIRSTNAME = 'Bob'.<

Support Snitz Forums
Go to Top of Page

fpgal
New Member

93 Posts

Posted - 10 February 2004 :  17:29:44  Show Profile

Thank you!

fpgal<
Go to Top of Page

dibley
New Member

United Kingdom
91 Posts

Posted - 31 March 2004 :  13:00:07  Show Profile  Visit dibley's Homepage
Thanks guys, I have found this thread most useful!
<

.:dib:.

www.nightsouls.co.uk - Uk clubber & music forum.
www.animatronica.co.uk - Creators of themepark animatronics.
Go to Top of Page
   Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.07 seconds. Powered By: Snitz Forums 2000 Version 3.4.07