Import Users from mailing list

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/60794?pagenum=1
05 November 2025, 08:45

Topic


amitch
Import Users from mailing list
24 January 2006, 14:18


We have a mailing list and we want to import the users from that to the forum. I have imported the users and have given the username as the email address itself and password as email address before @. I want the password to be the same as the username(which is the email address before @). Now the problem is how to encode that password. I see that the register page call inc_SHA256 to do this. how can i do it in access database without using this page. THanks
<

 

Replies ...


laser
24 January 2006, 14:25


How much do you know about writing ASP code ?
You have to loop around the records in the table, and SHA256 each as you go.
If you don't know ASP, it might be simpler to hit the "forgot password" link for every member and they can fix it themselves - depends on the quantity of members you have.<
amitch
24 January 2006, 14:36


I know asp well but then i would have to run the asp page for as many number of times as the number of users.<
laser
24 January 2006, 15:07


run the asp page for as many number of times as the number of users.
No, just once to loop around all database records.<
emperezg
03 May 2007, 14:01


This can help to import users from a db table to the Members table with SHA256 function.

********************************************************
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->

<%
dim iCount, sCounting, txtPassword

strSql = "SELECT * FROM members"

Set rsGetForumName=Server.CreateObject("ADODB.Recordset")
Set rsInsertRow=Server.CreateObject("ADODB.Recordset")



'Open the recordset object executing the SQL
rsGetForumName.Open strSql,my_Conn,3,3
'set our variable count equal to the number of records


Dim myarray(45)

sCounting = rsGetForumName.recordcount

'Response.Write sCounting

For iCount = 0 to (sCounting - 1)

For i = 0 to 45
If rsGetForumName(i).Name = "M_PASSWORD" Then
'Response.Write SHA256(rsGetForumName(i)) & "<br/>"
myarray(i) = SHA256(rsGetForumName(i))
Else
'response.write rsGetForumName(i) & "<br/>" 'INSERT A ROW
myarray(i) = rsGetForumName(i)
End If

next

sSQL = "INSERT INTO FORUM_MEMBERS "
sSQL = sSQL & "(M_STATUS,M_NAME,M_USERNAME,M_PASSWORD,M_EMAIL,M_COUNTRY,M_HOMEPAGE,M_SIG,M_VIEW_SIG,M_SIG_DEFAULT,M_DEFAULT_VIEW,M_LEVEL,M_AIM,M_ICQ,M_MSN,M_YAHOO,M_POSTS,M_DATE,M_LASTHEREDATE,M_LASTPOSTDATE,M_TITLE,M_SUBSCRIPTION,M_HIDE_EMAIL,M_RECEIVE_EMAIL,M_LAST_IP,M_IP,M_FIRSTNAME,M_LASTNAME,M_OCCUPATION,M_SEX,M_AGE,M_DOB,M_HOBBIES,M_LNEWS,M_QUOTE,M_BIO,M_MARSTATUS,M_LINK1,M_LINK2,M_CITY,M_STATE,M_PHOTO_URL,M_KEY,M_NEWEMAIL,M_PWKEY,M_SHA256)"
sSQL = sSQL & " VALUES("

For i = 0 to (UBound(myarray))

If IsNumeric(myarray(i)) Then 'Number
sSQL = sSQL & myarray(i) & ","
Else
sSQL = sSQL & "'" & myarray(i) & "',"
End If

'response.write myarray(i) & "<br/>"


Next

sSQL = left(sSQL, len(sSQL)-1)
sSQL = sSQL & ")"


'set rsInsertRow = my_Conn.Execute(sSQL)
rsInsertRow.Open sSQL,my_Conn,3,3
'rsInsertRow.close
'set rsInsertRow = nothing



response.write sSQL & "<br/>"

'response.write rsGetForumName(iCount) & "<br/>"
rsGetForumName.moveNext

next

%><
© 2000-2021 Snitz™ Communications