Membership Database Export Mod? - Posted (690 Views)
Starting Member
attafox
Posts: 2
2
Is there a mod for exporting all the fields in the membership database for reporting and outside tracking? Right now, we're doing this manually and it really gets painful if you don't keep up with it.<
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Forum Moderator
AnonJr
Posts: 5768
5768
There isn't one that I know of, but if you're reasonably skilled in ASP you could write a page to generate the reports you needed as an Excel spreadsheet, Word document, or any other of a variety of formats.
Just out of curiosity, what are you trying to track and report?<
Posted
Junior Member
PPSSWeb
Posts: 312
312
attafox,

Here is a quick and dirty solution for you. It is based on code I use to export vaious database fields for tracking purposes.
Copy the following code (between the bars) to a file with an asp extension (in your forum directory).
<%

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

dim strFilename
dim writestat
dim strDate
dim strColumns
strFilename = "<filepath>\members.txt"
strDate = Date & "; " & FormatDateTime(Now,4) & vbnewline
strColumns = "Member ID; Member Name; Member Level" & vbnewline

dim strNames
strNames = strDate & strColumns
strSql = "SELECT ME.MEMBER_ID, ME.M_NAME, ME.M_LEVEL " & _
"FROM " & strTablePrefix & "MEMBERS ME "
set rsAM = my_conn.execute (strSql)
if rsAM.EOF or rsAM.BOF then
else
do until rsAM.EOF
strNames = strNames & " " & rsAM("MEMBER_ID") & "; " rsAM("M_NAME") & "; " & rsAM("M_LEVEL") & vbnewline
rsAM.movenext
loop
rsAM.close
set rsAM = nothing
end if

writestat = WriteToFile(strFilename, strNames, true)

Response.Write "<b>Outputing Member Details<p> File saved to: <br>" & strFilename & " </b>"

function WriteToFile(FileName, Contents, Append)
on error resume next

if Append = true then
iMode = 8
else
iMode = 2
end if
set oFs = server.createobject("Scripting.FileSystemObject")
set oTextFile = oFs.OpenTextFile(FileName, iMode, True)
oTextFile.Write Contents
oTextFile.Close
set oTextFile = nothing
set oFS = nothing

end function

%>

Be sure to change the path to a valid path on your server where you can write the file. Also, you may want to modify the data fields exported.

The semicoln delimited output will be appended to the text file each time the asp page is loaded. The output file can be opened in a spreadsheet program like excel to see the data in a column format.
Hope this helps.<
Posted
Starting Member
attafox
Posts: 2
2
Our ISP has crashed on occasion and even though they reassure us of continual backups, we have lost the entire membership on a few occasions. We also get duplicate sign-ins which we don't allow and it's much easier to catch identical IP addresses externally.<
Posted
Forum Moderator
AnonJr
Posts: 5768
5768
Ahhh. As for the duplicate sign-ins, why not just enable the 'require unique e-mail address' option? It should at least cut down on it....
As to your other dilemma, what type of database are you using?<
Posted
Starting Member
Pull My Finger
Posts: 43
43
Originally posted by attafox
Our ISP has crashed on occasion and even though they reassure us of continual backups, we have lost the entire membership on a few occasions.
I make it a point not to trust something in someone else's hands! That's why I make it a point to do a "FULL Site Backup" once a month and a "database backup" once a week!
That way all the files are in my hands and not someone else's!<
 
You Must enter a message