473,413 Members | 1,679 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,413 software developers and data experts.

Convet VB.net code to Vb 6.0 code

Hi

I want to convert my Vb.net code to VB6.0

I am seaching for the code to update the active directory , but not able to find in Vb 6.0

can u please tell me any ay to convert that code into vb6.0
Public Interface test


Public Interface test
Sub GetActiveDiretoryInformation()
Sub SingleSynchronization(ByVal strCDGUID As String)
End Interface
Public Class CD2AD
Inherits BusinessComponent
Implements test
Public Sub New()
End Sub
' static string strConnectionString = GenericConfiguration.CompanyDirectoryDatabaseConne ctionString;
Private Shared strConnectionString As String ="server=WSINTRA13;uid=InSite.user;pwd=insiteslc1; database=SLCCorpDir"

Private Shared strADGUID As String = String.Empty

Public Sub GetActiveDiretoryInformation() Implements test.GetActiveDiretoryInformation
Dim domainRoot As String = "LDAP://DC=app,DC=hbi,DC=net"
'string domainRoot = GenericConfiguration.ADLocationPrefix;
'string strUser = GenericConfiguration.AdUsername;
'string strPassword = GenericConfiguration.AdPassword;
Dim strUser As String = "username"
Dim strPassword As String="pwd"

Dim search As New DirectorySearcher(New DirectoryEntry(domainRoot, strUser, strPassword, AuthenticationTypes.Secure))

Dim adUserGuid As Guid
'<GUID=" + adUserGuid + ">
'search.Filter = String.Format(CultureInfo.InvariantCulture, "(&(GUID={0})(objectClass=person))", "051f42eb120afd4e97d7671e292b1ebd");
search.Filter = String.Format(CultureInfo.InvariantCulture, "(&(cn={0})(objectClass=person))","ccc.ddd")
search.SearchScope = SearchScope.Subtree
'SearchResult result = search.FindAll();
Dim result As SearchResult = search.FindOne()
If Not result Is Nothing Then
Dim userFound As DirectoryEntry = result.GetDirectoryEntry()
adUserGuid = New Guid(userFound.NativeGuid)
Console.WriteLine("Current title : " & userFound.Properties("mail")(0).ToString())
'Console.WriteLine("Current Company : " +userFound.Properties["company"][0].ToString());
userFound.Properties("mail").Value = "xxx.yyy@xyz.com"
'userFound.Properties["company"].Value="ggg";
userFound.CommitChanges()
End If
End Sub

Public Sub SingleSynchronization(ByVal strCDGUID As String) Implements test.SingleSynchronization

Dim connection As New SqlConnection(strConnectionString)
Dim strQuery As String = "select * from person where ID=" & "'" & strCDGUID & "'"
Try
connection.Open()
Dim da As New SqlDataAdapter(strQuery, connection)
Dim ds As New DataSet()
da.Fill(ds, "person")
Dim dt As DataTable = ds.Tables("person")
For Each row As DataRow In dt.Rows
For Each col As DataColumn In dt.Columns
Console.WriteLine(row(col))
Next col

Next row
GetActiveDiretoryInformation()
Catch e As Exception
Console.WriteLine("Error: " & e)
Finally
connection.Close()
End Try
End Sub


<STAThread> _
Shared Sub Main(ByVal args() As String)
Dim test1 As New CD2AD()
test1.GetActiveDiretoryInformation()
test1.SingleSynchronization("bd1b2ce5f9bb9546b032a af0008dc9ea")

End Sub
End Class
End Namespace
Dec 3 '08 #1
2 1732
debasisdas
8,127 Expert 4TB
.net code is not backword compratable with VB 6.0
Dec 3 '08 #2
Please can u tell me any other way to convert that code

I need that urgently .

or any artical that i refer for writing into active directory in VB6.0
Dec 3 '08 #3

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

Similar topics

51
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
9
by: bigoxygen | last post by:
Hi. I'm using a 3 tier FrontController Design for my web application right now. The problem is that I'm finding to have to duplicate a lot of code for similar functions; for example, listing...
4
by: jason | last post by:
Hello. Newbie on SQL and suffering through this. I have two tables created as such: drop table table1; go drop table table2; go
16
by: Dario de Judicibus | last post by:
I'm getting crazy. Look at this code: #include <string.h> #include <stdio.h> #include <iostream.h> using namespace std ; char ini_code = {0xFF, 0xFE} ; char line_sep = {0x20, 0x28} ;
109
by: Andrew Thompson | last post by:
It seems most people get there JS off web sites, which is entirely logical. But it is also a great pity since most of that code is of such poor quality. I was looking through the JS FAQ for any...
5
by: ED | last post by:
I currently have vba code that ranks employees based on their average job time ordered by their region, zone, and job code. I currently have vba code that will cycle through a query and ranks each...
0
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, Today we are going to look at Code Access Security. Code access security is a feature of .NET that manages code depending on its trust level. If the CLS trusts the code enough to...
18
by: Joe Fallon | last post by:
I have some complex logic which is fairly simply to build up into a string. I needed a way to Eval this string and return a Boolean result. This code works fine to achieve that goal. My...
1
by: ogo796 | last post by:
hi everyone i use software called unrtf to convet rtf file to html ,the problem is the software produce a blank html with no body tag can someone help me with that. thanks
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.