LDAP query onLoad in VB

S

SpecialK

I'm new to InfoPath (from some basic ASP) and I'm attempting to create a
PO/Procurement form for a corporate intranet.

I'd like to extract the current user's logon name onLoad and use that in an
LDAP query to return information on that user which could then be assigned
variables and placed in the order record. We'd prefer a real-time LDAP
connection to running a daily import to our procurement database (SQL Server
2000).

I'd prefer to do this in VBScript or Visual Basic (2005) but I'm having a
rough time finding any documentation. All InfoPath-related script
documentation seems to use JavaScript and Visual Studio documentation uses C#
or C++ for similar functions.

In a nutshell, I'm looking for some code snippets and a little direction to
get this project rolling. Best practices for this type of app would be
helpful.

Thanks!!!

k
 
S

S.Y.M. Wong-A-Ton

Just my 2 cents...

Although daunting for someone new to InfoPath, I would look into using web
services for this scenario if I were you, primarily to avoid security issues
and have loose coupling. You can check out lab 8
(http://msdn.microsoft.com/office/un...y/en-us/odc_ip2003_tr/html/odc_inf_lab_08.asp)
for directions on how to use web services in InfoPath.

The logon name can be retrieved through code (System.Environment.UserName)
and passed to the web service. The webservice can then use this information
to do the LDAP query. For the latter you can use System.DirectoryServices
(see
http://msdn.microsoft.com/library/d...s/cpref/html/frlrfSystemDirectoryServices.asp).
You should be able to find some code snippets on the web by doing a Google
search; I've even seen VB.NET code using DirectoryServices on MSDN.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top