M
MrHelpMe
Hello again experts,
I have successfully pulled data from an LDAP server and now what I want
to do is drop the data into a database table. The following is my code
that will insert the data but that has problems.
What is happening is for each user the fullname, email, given name and
address should get successfully entered into the database table however
some fullnames are getting the incorrect email address, given name etc.
while others are correct. Can anyone see a problem? I have checked the
data that is coming back from ldap and my code is definitely incorrect.
Why do some users get incorrect info...it's almost like they are
getting the prior users info.
I have successfully pulled data from an LDAP server and now what I want
to do is drop the data into a database table. The following is my code
that will insert the data but that has problems.
Code:
FullName=Request.Form("Name")
Email=Request.Form("Email")
GivenName=Request.Form("GivenName")
StreetAddress=Request.Form("StreetAddress")
FullNameDesc = Replace(FullName, "'", "''")
EmailDesc = Replace(Email, "'", "''")
GivenNameDesc = Replace(GivenName, "'", "''")
StreetAddressDesc = Replace(StreetAddress, "'", "''")
strFullName = Split(FullNameDesc,", ")
strEmailName = Split(EmailDesc,", ")
strGivenName = Split(GivenNameDesc,", ")
strStreetAddress = Split(StreetAddressDesc,", ")
Response.Buffer = True
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = (ConnectionInfoHidden)
objConn.Open
For i = 0 to Ubound(strFullName)
sSQL = "INSERT into Users (FullName, Email, GivenName,Address)"
sSQL = sSQL & "VALUES ('" & strFullName(i) &"', '"& strEmailName(i)
&"', '" & strGivenName(i) &"', '" & strStreetAddress(i) &"')"
'objConn.Execute sSQL
response.write sSql & "<BR>"
Next
What is happening is for each user the fullname, email, given name and
address should get successfully entered into the database table however
some fullnames are getting the incorrect email address, given name etc.
while others are correct. Can anyone see a problem? I have checked the
data that is coming back from ldap and my code is definitely incorrect.
Why do some users get incorrect info...it's almost like they are
getting the prior users info.