473,414 Members | 1,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

HELP:How to Pass LDAP value to MS Access on ASP file?

HI,

Do anyone know how to pass LDAP value from ldap_first.asp and post to value into MS Access Database? Please help. Billion thanks

----------------ldap_first.asp---------------------
<html>

<head>
<title>New Page 2</title>
</head>

<body>
<form name="form1" method="post" action="ldap_second.asp?v=<%=Request.Querystring(" v")%>&v2=<%=Request.Querystring("v2")%>">
<%
Dim conn
Dim objConn
Dim objRS
Dim v,v2

Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")
objConn.Provider = "ADsDSOObject"
strConn = "ADs Provider"
objConn.Open strConn

Set objRS = objConn.Execute("<LDAP://ldap2.it.tech.com/o=agilent.com>;(&(ntuserdomainid=tech:jose)(sn=lim ));sn,givenname,emailaddress,agilenttelnetnumber;S ubTree")

While Not objRS.EOF
response.write "<div align=center><p><b>User Logon details</b></p></div>"
response.write "<div align=center>"
response.write "<table border=1 cellpadding=5 cellspacing=0>"
v = objRS("sn")
response.write "<tr><td><b> Last Name: </b></td><td>" & v(0) & "</td></tr>"
v2 = objRS("givenname")
response.write "<tr><td><b> First Name: </b></td><td>" & v2(0) & "</td></tr>"
response.write "</table>"
response.write "</div>"

'response.write objRS(0)
'Response.Write isNull(objRS.Value)
objRS.MoveNext

Wend
'response.write "Test"
objConn.Close
%>

<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
</body>
</html>
-----------------------ldap_second.asp--------------------
<%
Dim objConn, objRs, objPara
Dim strSQL
Dim objCommand,v,v2

v = Request.Form("v")
v2 = Request.Form("v2")


Response.Buffer = True
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=Midwar"
objConn.Open


strSQL = "INSERT INTO Testing (LastName, FirstName) VALUES (" & _
"'" & Request.Form("v") & "', " & _
"'" & Request.Form("v2") & "') "

Response.Write strSQL & "<BR>"
objConn.Execute strSQL

%>
Sep 13 '06 #1
1 2206
Hi All,

I have the solution now. Put the form action script below the LDAP database execution script and form action script should be <form name="form1" method="post" action="Employee_addp_ldap.asp?v=<%=t%>&v2=<%=t2%> &v3=<%=t3%>&v4=<%=t4%>">.

This will work. :)

From: Jo
Sep 15 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Pola | last post by:
I am using VC++ in my application I create file every second and save on the disk at the same time another appl reads this file every second from the disk How I can know that file is in use. ...
2
by: Pola | last post by:
Please Help I am using VC++.NET In my appl I have to disable access to some disks in the network How I can do it thank you Pol
1
by: rajesh | last post by:
hi all i have a doubt! i want to compare two files,one is a xml file which has some certain rules,and the otherone is a "c" file. i want to check each and every line of the "c" file which should...
2
by: david | last post by:
1.I am considering doing a midi file generator for my 4th year project in B.SC. 2.I would do it using c language, but i'm not sure abou t the level of difficulyt involved 3.Basically, the...
2
by: Andy Chen | last post by:
Hi, I have to verify a lot of installation packages which are digital signed. You can verify a file on the property sheet, but I am working on southands of files. I am planning to create a tool to...
15
by: sunchunkui | last post by:
Dear all, I have an Access mdb file which I updated every other week on a server. There are multiple users to access it. Usually when if somebody is using it, I can see .ldb file under that...
1
by: fatima.issawi | last post by:
Hello, I would like to open a pdf file in a new window from my code behind page. The code I have currently doesn't seem to work: Response.Write("<script language='javascript'{...
1
by: Sachin Shah | last post by:
<?php ?> <html> <head> <script language="javascript"> function getpath() { var pname = document.form1.fr.value; return pname; } </script>
14
by: neelsfer | last post by:
I am involved with government healthcare facilities and have 40 small healthcare facilities in remotes villages that i supervise, here in rural South Africa. The people are quite computer illiterate...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.