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 DEV-Group
 DEV Discussions (General)
 Question about admin_mod_dbsetup.asp
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

pweighill
Junior Member

United Kingdom
453 Posts

Posted - 20 August 2002 :  15:35:54  Show Profile
Lines 295 to 311 (for CREATE TABLE) are:
select case strDBType
case "access"
fType = replace(fType,"varchar (","text (")
case "sqlserver"
select case sqlVer
case 7
fType = replace(fType,"memo","ntext")
fType = replace(fType,"varchar","nvarchar")
fType = replace(fType,"date","datetime")
case else
fType = replace(fType,"memo","text")
end select
case "mysql"
fType = replace(fType,"memo","text")
fType = replace(fType,"#int","#int (11)")
fType = replace(fType,"#smallint","#smallint (6)")
end select


Lines 376 to 391 (for ALTER TABLE) are:
select case strDBType
case "access"
fType = replace(fType,"varchar","text")
case "sqlserver"
select case sqlVer
case 7
fType = replace(fType,"memo","ntext")
fType = replace(fType,"varchar","nvarchar")
fType = replace(fType,"date","datetime")
case else
fType = replace(fType,"memo","text")
end select
case "mysql"
fType = replace(fType,"#int","#int (11)")
fType = replace(fType,"#smallint","#smallint (6)")
end select


(also similar code in admin_mod_dbsetup2.asp)

Does anybody know why the access & mysql sections are different?

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 20 August 2002 :  22:29:43  Show Profile  Visit HuwR's Homepage
because they have different SQL syntax
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 21 August 2002 :  01:10:05  Show Profile  Visit Nathan's Homepage
He means between the top set and the bottom set.

And really, I dont understand why this
		fType = replace(fType,"memo","text") 
exists in the create but not in the alter. . . I think this might be a bug, but I'm not sure.

The access part looks just fine though, the parenthesis are there for the new table just like we have parentesis in insert statements INSERT INTO ( but not in update statments UPDATE SET

Nathan Bales
CoreBoard | Active Users Download
Go to Top of Page

pweighill
Junior Member

United Kingdom
453 Posts

Posted - 21 August 2002 :  04:22:21  Show Profile
quote:
Originally posted by HuwR

because they have different SQL syntax



What I'm wondering is why the ( in the CREATE for access

For CREATE: fType = replace(fType,"varchar (","text (")
For ALTER: fType = replace(fType,"varchar","text")

And the CREATE for mysql has
fType = replace(fType,"memo","text")
but the ALTER doesn't

Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 21 August 2002 :  05:08:03  Show Profile
I made the Alter section look exactly like the Create section in both files.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 21 August 2002 :  07:08:35  Show Profile  Visit HuwR's Homepage
I'm pretty sure I did this

fType = replace(fType,"varchar (","text (")

for a reason, so make sure both sections have the "text (" and not the "text"

basically the alter section came first and was copied to the create section, which was then updated to fix issues, obviously the same issues were never found doing an alter.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 21 August 2002 :  07:10:50  Show Profile
do you think it will cause any problems having the ( in there in the CREATE section? if so, I can just change it back.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 21 August 2002 :  07:18:51  Show Profile  Visit HuwR's Homepage
the ( should be there in both sections
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 21 August 2002 :  07:23:13  Show Profile
ok, thanks.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 21 August 2002 :  07:31:55  Show Profile  Visit HuwR's Homepage
no probs, I think probably the best solution is to use the CREATE template and copy over the ALTER part
Go to Top of Page

pweighill
Junior Member

United Kingdom
453 Posts

Posted - 21 August 2002 :  08:27:37  Show Profile
quote:
Originally posted by HuwR

the ( should be there in both sections



See the quote in http://forum.snitz.com/forum/topic.asp?TOPIC_ID=33183 for an example of the differences between the CREATE and ALTER.

If you have:
case "access"
fType = replace(fType,"varchar (","text (")


Then should you also do:
 	fType = replace(fType,"varchar(","text(")

as well?
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 21 August 2002 :  08:36:21  Show Profile  Visit HuwR's Homepage
I'm sorry, but there is a set of instructions telling you how you should write the dbs files, if they don't write them correctly, then its their fault.


What has your other topic got to do with this one, it may be the same file, but they are different issues.

I don't think it should have beend included in the base code anyway.
Go to Top of Page

pweighill
Junior Member

United Kingdom
453 Posts

Posted - 21 August 2002 :  08:43:29  Show Profile
The dbs file included with the Hotkeys mod does not contain a space between varchar and (
So it would be shown as varchar( rather than text( for access databases.

HotKeys MOD
[CREATE]
HOTKEYS
HK_ID
MEMBER_ID#int#NULL#
HOTKEY#VARCHAR(250)#NULL#
[END]
[ALTER]
HOTKEYS
ADD#HOTKEY_NICK#VARCHAR(50)#NULL#
[END]


So you're saying the dbs file needs some spaces adding to it.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 21 August 2002 :  09:41:53  Show Profile  Visit HuwR's Homepage
no the only one that looks for the ( is text, so that is the only one that needed a space it is not necesary for varchar

because it replaces memo with ntext, then replaces text with varchar so it needed the ( to distinguish it from ntext
Go to Top of Page

pweighill
Junior Member

United Kingdom
453 Posts

Posted - 21 August 2002 :  09:43:07  Show Profile
quote:
Originally posted by HuwR

I'm sorry, but there is a set of instructions telling you how you should write the dbs files, if they don't write them correctly, then its their fault.



Does any body know where this is.

Perhaps there could be a sticky topic added in both "MOD Add-On Forum (W/Code)" and "MOD Add-On Forum (W/O Code)" telling everyone where it is.

Or perhaps a URL like in the "Snitz Forums 2000 MOD-Group"
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 21 August 2002 :  11:32:58  Show Profile  Visit Nathan's Homepage
You can find the instructions buried somewhere deep in the archives of the mySql help forum. . .

Nathan Bales
CoreBoard | Active Users Download
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07