<%= OutputCSS() %>
Fast Member Importer :       Help

<% Dim memImport, objCom, nopass, SQL, delimiter, otherdelimiter, arrMemImport, objCon, adminIP Dim defaultViewingFormat nopass = request.form("nopass") memImport = trim(request.form("memImport")) delimiter = request.form("delimiter") adminIP = Request.ServerVariables("REMOTE_ADDR") defaultViewingFormat = Application(dbName&"viewPref") SELECT Case delimiter Case "tab" delimiter = chr(9) Case "other" delimiter = request.form("otherdelimiter") Case Else delimiter = delimiter End SELECT arrMemImport = split(memImport,vbcrlf) Dim dupErr, totalErr, delimiterErr, errorMsg, status, isError, totalImported, blankLines, beginTime dupErr = 0 totalErr = 0 delimiterErr = 0 totalImported = 0 blankLines = 0 isError = false if isArray(arrMemImport) and delimiter<> "" then set objCon = server.createobject("adodb.connection") objCon.open datastore beginTime = timer() Dim iEachImport, arrEachImport, password For iEachImport = 0 to ubound(arrMemImport) if trim(arrMemImport(iEachImport))<>"" then arrEachImport = split(trim(arrMemImport(iEachImport)), delimiter) if ubound(arrEachImport)>=1 and ubound(arrEachImport)<=2 then if ubound(arrEachImport)=1 then if nopass="login" then password = arrEachImport(0) else password = arrEachImport(1) end if else if Trim(arrEachImport(2))<>"" then password = arrEachImport(2) else if nopass="login" then password = arrEachImport(0) else password = arrEachImport(1) end if end if end if set objCom = server.createobject("adodb.command") with objCom .activeconnection = objCon .commandText = dbOwnerPrefix&"spRegister" .commandType = adCmdStoredProc .Parameters.Append .Createparameter("@RETURN_VALUE", adInteger, adParamReturnValue) .Parameters.Append .Createparameter("@tempPass", adVarChar, adParamInput, 50, "") .Parameters.Append .Createparameter("@Userpass", adVarChar, adParamInput, 50, Trim(password)) .Parameters.Append .Createparameter("@Login", adVarChar, adParamInput, 50, Trim(arrEachImport(0))) .Parameters.Append .Createparameter("@Fname", adVarChar, adParamInput, 50, "") .Parameters.Append .Createparameter("@Lname", adVarChar, adParamInput, 50, "") .Parameters.Append .Createparameter("@Email", adVarChar, adParamInput, 50, Trim(arrEachImport(1))) .Parameters.Append .Createparameter("@homepage", adVarChar, adParamInput, 50, "") .Parameters.Append .Createparameter("@signature", adVarChar, adParamInput, 255, "") .Parameters.Append .Createparameter("@ip", adVarChar, adParamInput, 50, adminIP) .Parameters.Append .Createparameter("@viewpref", adUnsignedTinyInt, adParamInput, 0, defaultViewingFormat) .Parameters.Append .Createparameter("@regStatus", adUnsignedTinyInt, adParamInput, 0, 0) .Parameters.Append .Createparameter("@memberID", adInteger, adParamOutput, 0 ) .execute , , adExecuteNoRecords status = .Parameters("@RETURN_VALUE") end with set objCom = nothing if status = 1 then totalErr = totalErr + 1 dupErr = dupErr + 1 isError = true errorMsg = "Duplicate Record (login or e-mail) found for: "&arrMemImport(iEachImport) else totalImported = totalImported + 1 end if else totalErr = totalErr + 1 delimiterErr = delimiterErr + 1 isError = true errorMsg = "Wrong Delimiter, or Delimiter Error: "&arrMemImport(iEachImport) end if if isError = true then isError = false response.write (""&errorMsg&"


") response.flush end if else blankLines = blankLines + 1 end if next Dim objRS set objRS = objCon.Execute (dbOwnerPrefix&"spGetTotalMem") Application.lock Application(dbName&"totalMem") = objRS("totalMem") Application.unlock set objRS = nothing objCon.close set objCon = nothing response.write ("Member Importing Finished ("&timer()-beginTime&" seconds).

") response.write ("Total Imported: "&totalImported&"

") response.write ("Total Blank Entries: "&blankLines&"

") response.write ("Duplicate Error Found: "&dupErr&"

") response.write ("Wrong Delimiter Error Found: "&delimiterErr&"

") response.write ("Total Error Found: "&totalErr&"

") end if %>
> > >
Fast Member Importer
Step 1: What's your delimiter?  
Comma [,]   Pipe [|]   Tab [Keyboard Tab]   Other [
Step 2: Copy and paste your member info:
Step 3: If you do not specify password in your file, which one of the following would you want to use as member's new password?
Login Name (first parameter)    Member's E-mail (second parameter)