Ok, it looks like a lot of people are asking for this, let me point out that
these examples work in ASP. They code displayed has nothing special for
imail or any specific DB, they will work with MS-SQL and Access, and also
this will obviously need you to have the domain set for external database.
Let me point out that the way I have it on my site is that I use the same DB
for imail and the rest of the applications on the website. The all caps
words means that the word is something that you have to specify and differs
from one DB to another
1-First we check if the user already exists:
'## check if userid is taken
Set Conntemp = Server.CreateObject("ADODB.Connection")
Conntemp.open DBPATHVARIABLE
SQLSelect = "select TBLNAME.USERID from TBLNAME"
If Err.Number = 0 Then
set rstemp = conntemp.execute(SQLSelect)
do while rstemp.eof = false
if lcase(userid) = lcase(rstemp("userid")) then
response.redirect("some url that tells that that the
userid is taken")
end if
rstemp.movenext
loop
End If
'##### if the code goes through this, it means that the login the user
entered does not exist in DB, else it will redirect him to a page which you
specify telling him/her that the userid is taken
2-Insert user to DB
'## SQL INSERT statement to DB
Set DatabaseConnection = Server.CreateObject("ADODB.Connection")
DatabaseConnection.Open DBPATHVARIABLE
set commandObject = Server.CreateObject("ADODB.Command")
commandObject.ActiveConnection = DatabaseConnection
strInsertSql = "Insert into tbl_Users (userid, Password, FullName, UserDir,
MailAddr)"
StrInsertSql = StrInsertSql & " values ('" & userid & "', '"
StrInsertSql = StrInsertSql & Password & "', '"
StrInsertSql = StrInsertSql & Replace(FullName,"'","") & "', '"
StrInsertSql = StrInsertSql & Replace(UserDir,"'","")& "', '"
StrInsertSql = StrInsertSql & Replace(MailAddr,"'","") & "', '"
StrInsertSql = StrInsertSql & ipaddress & "')"
If Err.Number = 0 Then
DatabaseConnection.execute StrinsertSql
End If
Now of course, you have to a page setup to submit the values to these
variables in this form. And this is NOT all the fields that are required to
setup a fully working DB for imail, i put these for example
I'm not sure if this is what everyone was asking/hoping for, let me know if
you have any questions
______________________________________________________________________
The HKSI-IMail Admin List is hosted by........ Humankind Systems, Inc.
Questions, Comments or Glowing Praise...... mailto:[EMAIL PROTECTED]
Searchable List Archive.... http://www.mail-archive.com/[email protected]
To Manage your Subscription......... http://humankindsystems.com/lists