Author |
Topic  |
|
yaak
Starting Member
USA
12 Posts |
Posted - 13 June 2002 : 10:05:52
|
Looking for some assis on using the NT authentication method. I am using the latest snitz forum, and would like to try to use our exsisting NT authentication method if posible.
When I set the forum for NT authentication, and a user tries to creat a new account, I get:
Error Type Microsoft OLE DB Privider for ODBC Drivers (0x80004005) [Microsoft][ODBC Microsoft Access Driver] Field 'FORUM_MEMBERS.MPASSWORD' cannot be a zero-lenth string, /help/snitz30/register.asp, line 295
When trying to register after activating the NT authentication methon, there is no option for a password, wich I can understand, but what coding and how, do I change to allow for this.
We are on an intranet, and arent connected to the outside world, so this would be a preferable method over having users have to create a seperate account for the forum.
Thank you
Edited by - ruirib on 13 June 2002 10:10:04 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 13 June 2002 : 10:21:48
|
You need to change the settings for the M_PASSWORD field in the FORUM_MEMBERS table, so that this field does allow zero length strings. This should be a way to fix. You need to download the database, change the field/table and upload it again.
I believe you could also change register.asp, because the M_PASSWORD field is being added even for NT authentication, which could cause this problem:
Around line 166 in register.asp, change this:
if strAuthType = "nt" then strSql = strSql & ", M_USERNAME" end if
strSql = strSql & ", M_PASSWORD" strSql = strSql & ", M_EMAIL"
...
to this:
if strAuthType = "nt" then strSql = strSql & ", M_USERNAME" end if
if strAuthType = "db" then strSql = strSql & ", M_PASSWORD" end If
strSql = strSql & ", M_EMAIL"
...
Maybe try the code change first. Backup you current file, insert the changes, try to register. If it goes OK, you're done. If not, change the database as I explained.
------------------------------------------------- Installation Guide | Do's and Dont's | MODs
Edited by - ruirib on 13 June 2002 10:26:54 |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 13 June 2002 : 10:47:00
|
Ok, I forgot a needed additional change:
Around line 206, find:
if strAuthType = "nt" then strSql = strSql & ", " & "'" & strDBNTUserName & "'" end if
strSql = strSql & ", " & "'" & chkString(Request.Form"Password"),"password") & "'" strSql = strSql & ", " & "'" & chkString(Request.Form("Email"),"SQLString") & "'"
Change it to :
if strAuthType = "nt" then strSql = strSql & ", " & "'" & strDBNTUserName & "'" end if
if strAuthType = "db" then strSql = strSql & ", " & "'" & chkString(Request.Form("Password"),"password") & "'" end If
strSql = strSql & ", " & "'" & chkString(Request.Form("Email"),"SQLString") & "'"
This change and the previous one should fix it, then.
------------------------------------------------- Installation Guide | Do's and Dont's | MODs
Edited by - ruirib on 13 June 2002 10:53:56 |
 |
|
yaak
Starting Member
USA
12 Posts |
Posted - 13 June 2002 : 11:15:04
|
Ah, i see.
should have thought of that, but wasnt thinking too clearly. what i did was changed the settings on the database. the fileds were default to allow zero lenth, no, so i had to set it to yes on several besides the password. it got stuck on a few others such as occupation...
thank you for the info, it saved me quite a headache.
quote:
You need to change the settings for the M_PASSWORD field in the FORUM_MEMBERS table, so that this field does allow zero length strings. This should be a way to fix. You need to download the database, change the field/table and upload it again.
I believe you could also change register.asp, because the M_PASSWORD field is being added even for NT authentication, which could cause this problem:
Around line 166 in register.asp, change this:
if strAuthType = "nt" then strSql = strSql & ", M_USERNAME" end if
strSql = strSql & ", M_PASSWORD" strSql = strSql & ", M_EMAIL"
...
to this:
if strAuthType = "nt" then strSql = strSql & ", M_USERNAME" end if
if strAuthType = "db" then strSql = strSql & ", M_PASSWORD" end If
strSql = strSql & ", M_EMAIL"
...
Maybe try the code change first. Backup you current file, insert the changes, try to register. If it goes OK, you're done. If not, change the database as I explained.
------------------------------------------------- Installation Guide | Do's and Dont's | MODs
Edited by - ruirib on 13 June 2002 10:26:54
|
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 13 June 2002 : 15:14:33
|
you could also do this:
if strAuthType = "nt" then strSql = strSql & ", '" & strDBNTUserName & "'" else strSql = strSql & ", '" & chkString(Request.Form("Password"),"password") & "'" end If |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 13 June 2002 : 15:18:07
|
quote:
you could also do this:
if strAuthType = "nt" then strSql = strSql & ", '" & strDBNTUserName & "'" else strSql = strSql & ", '" & chkString(Request.Form("Password"),"password") & "'" end If
Looks like the obvious is not so obvious, sometimes ...
------------------------------------------------- Installation Guide | Do's and Dont's | MODs |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 13 June 2002 : 16:42:49
|
I've got and additional question on this issue. Yaak complained there were additional similar problems with other fields. That seems to result from the fact that the values are read from the form, whether they have been filled or not. Shouldn't a test be done on the values read from the forms, for all fields defined in the database as not allowing zero-length strings and only if they were different from "" add the column to the SQL statement.
I know it will give a bit of work, but looks like the best thing to do. What do you think?
------------------------------------------------- Installation Guide | Do's and Dont's | MODs |
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 13 June 2002 : 16:52:22
|
What we did for v3.4 is make sure that a default value is assigned to each field in the database. That way, if we add a record and a certain field isn't assigned a value when the record is inserted, it will get the default value. Of course, existing databases won't have these default values set, but if they go through and set a default value for each field, then it will solve this problem. |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
|
|
Topic  |
|
|
|