| Author |  Topic  | 
              
                | pweighillJunior Member
 
   
 
                United Kingdom453 Posts
 | 
                    
                      |  Posted - 20 August 2002 :  15:35:54   
 |  
                      | Lines 295 to 311 (for CREATE TABLE) are: 
 select case strDBTypecase "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 strDBTypecase "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?
 
 |  | 
              
                | HuwRForum Admin
 
      
 
                United Kingdom20611 Posts
 | 
                    
                      |  Posted - 20 August 2002 :  22:29:43     
 |  
                      | because they have different SQL syntax |  
                      |  |  | 
              
                | NathanHelp Moderator
 
      
 
                USA7664 Posts
 | 
                    
                      |  Posted - 21 August 2002 :  01:10:05     
 |  
                      | 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
 |  
                      |  |  | 
              
                | pweighillJunior Member
 
   
 
                United Kingdom453 Posts
 | 
                    
                      |  Posted - 21 August 2002 :  04:22:21   
 |  
                      | 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
 
 
 |  
                      |  |  | 
              
                | RichardKinserSnitz Forums Admin
 
      
 
                USA16655 Posts
 | 
                    
                      |  Posted - 21 August 2002 :  05:08:03   
 |  
                      | I made the Alter section look exactly like the Create section in both files. |  
                      |  |  | 
              
                | HuwRForum Admin
 
      
 
                United Kingdom20611 Posts
 | 
                    
                      |  Posted - 21 August 2002 :  07:08:35     
 |  
                      | 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.
 
 |  
                      |  |  | 
              
                | RichardKinserSnitz Forums Admin
 
      
 
                USA16655 Posts
 | 
                    
                      |  Posted - 21 August 2002 :  07:10:50   
 |  
                      | do you think it will cause any problems having the ( in there in the CREATE section?  if so, I can just change it back. |  
                      |  |  | 
              
                | HuwRForum Admin
 
      
 
                United Kingdom20611 Posts
 | 
                    
                      |  Posted - 21 August 2002 :  07:18:51     
 |  
                      | the ( should be there in both sections |  
                      |  |  | 
              
                | RichardKinserSnitz Forums Admin
 
      
 
                USA16655 Posts
 | 
                    
                      |  Posted - 21 August 2002 :  07:23:13   
 |  
                      | ok, thanks. |  
                      |  |  | 
              
                | HuwRForum Admin
 
      
 
                United Kingdom20611 Posts
 | 
                    
                      |  Posted - 21 August 2002 :  07:31:55     
 |  
                      | no probs, I think probably the best solution is to use the CREATE template and copy over the ALTER part |  
                      |  |  | 
              
                | pweighillJunior Member
 
   
 
                United Kingdom453 Posts
 | 
                    
                      |  Posted - 21 August 2002 :  08:27:37   
 |  
                      | 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?
 |  
                      |  |  | 
              
                | HuwRForum Admin
 
      
 
                United Kingdom20611 Posts
 | 
                    
                      |  Posted - 21 August 2002 :  08:36:21     
 |  
                      | 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.
 
 |  
                      |  |  | 
              
                | pweighillJunior Member
 
   
 
                United Kingdom453 Posts
 | 
                    
                      |  Posted - 21 August 2002 :  08:43:29   
 |  
                      | 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.
 |  
                      |  |  | 
              
                | HuwRForum Admin
 
      
 
                United Kingdom20611 Posts
 | 
                    
                      |  Posted - 21 August 2002 :  09:41:53     
 |  
                      | 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
 |  
                      |  |  | 
              
                | pweighillJunior Member
 
   
 
                United Kingdom453 Posts
 | 
                    
                      |  Posted - 21 August 2002 :  09:43:07   
 |  
                      | 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"
 |  
                      |  |  | 
              
                | NathanHelp Moderator
 
      
 
                USA7664 Posts
 | 
                    
                      |  Posted - 21 August 2002 :  11:32:58     
 |  
                      | You can find the instructions buried somewhere deep in the archives of the mySql help forum. . . |  
                      | 
  Nathan Bales CoreBoard | Active Users Download
 |  
                      |  |  | 
              
                
                |  Topic  |  |