|
Hi how do I add user in windows users and groups with code?
Progress is a process , so value it
|
|
|
|
|
This depends on what provider you wish to use.
With the LDAP Provider, you perform the following:
Imports ActiveDS
Dim ObjOU As ActiveDs.IADsOU
Dim moNativeIADsObject As IADsUser
Dim mstrUsername as string = "NewUserName"
Dim mstrOUPath as string = "DC=MyDomain,DC=com"
Dim mstrPassword as string = "Asecret1"
'Connect to the Organisation Unit (OU) where the account is to be created using OrgUnit
ObjOU = GetObject("LDAP://" & mstrOUPath)
'Create the account
moNativeIADsObject = ObjOU.Create("User", "CN=" & mstrUsername)
moNativeIADsObject.Put("samAccountName", mstrUsername)
moNativeIADsObject.SetInfo()
' Ref: http://www.microsoft.com/technet/scriptcenter/guide/sas_ads_zjvb.mspx?mfr=true
moNativeIADsObject.SetPassword(mstrPassword)
moNativeIADsObject.SetInfo()
|
|
|
|
|
Hi
I have used WinNt. It works fine but now I need to add the user via a Web service. I have a web method that attemts to create the user but acess is denied which I expect but I need to side this problem
Progress is a process , so value it
|
|
|
|
|
A Web Service runs under an account that doesn't have any rights to the domain to add users. Your web service code has to get the username and password of a domain administrator account so it can use those credentials so it can Impersonate the user adding the account to the domain.
Google for "web service impersonation" for all kinds of info, pitfalls, examples, ...
|
|
|
|
|
Is there a simple way to group a bunch of SQL update statements (in VB.Net) together in a transaction scope?
The way that I used, is giving me ENDLESS hassles and problems with MSDTC services and firewalls and and and and and and AND AND AND , it requires that I change various system settings including components services on ALL clients and the server and that I do registry edits etc etc. And STILL it fails on some PC's!
It's just not worth all that hassle!
I am not looking for a solution that involves calling a stored procedure because I'm working with Datasets and their built-in functionality in .Net.
I would appreciate any help from anyone with prior knowledge of such a solution!
_______________________________________________________________________
http://www.readytogiveup.com/[ ^]
"you can't forget something you never knew..." M. Du Toit
|
|
|
|
|
|
Thank You!
That seems to be what I needed!
_______________________________________________________________________
http://www.readytogiveup.com/[ ^]
"you can't forget something you never knew..." M. Du Toit
|
|
|
|
|
i am having this error when i am about to delete a data row
inline with this is a message box saying:
object reference not set to an instance of an object. do you want to correct the value?
if i click yes, it will delete the row if no it will ignore the deletion
i've already checked all of my declarations and pretty sure that i've declared everything right. please help me about this. thanx!
|
|
|
|
|
Normally this error acurs when you are accessing a variable that hasn't been initialized yet
for instance
dim s as datatable
s.delete... ' this will give your error
s = new datatable...
The right way would be
dim s as datatable
s= new datatable...
s.delete...
the best way to check if this is the case is asinging a stander value to your variables and then try it again if you still get te error something else is going on
|
|
|
|
|
it has nothing to do with the declaration... ive just mentioned that i already checked the declaration. it has something to do with the datagrid, its properties and errors bound to it. but thanx anyway.
|
|
|
|
|
OK. You're calling a method or setting/reading a property on what you think is a valid object that isn't actually pointing to an instance of an object. In other words, you're trying to do something like Nothing.Method(params) . Obviously, Nothing , or null in C# doesn't have any methods or properties, so this will throw the message you're talking about.
There is nothing wrong with the DataGrid that will cause this problem. It's being thrown by code you wrote. Perhaps you're calling a method on an object your code is assuming exists, probably as a return value from a method, or as an object in a collection where the collection doesn't have any objects in it, when it should be checking for the existance of an object before it tries to use it.
|
|
|
|
|
ok i get it... but how could i resolve the problem? i am trying to catch the error but the try and catch does'nt work with it. thanx!
|
|
|
|
|
The problem is going to be in either the code that setup the DataAdapter or TableAdapter that you're using, or in the code you're using to do the Update. Without seeing any of this code, it's impossible for anyone to tell you what's wrong.
|
|
|
|
|
I've found out that in order to use my user controls in ms access I'll need to write them as activex controls (ocx) but I can't seem to get it working in vb.net.
Anyone have any experiance doing this?
|
|
|
|
|
|
I've been looking at that one for the better part of the day now and can't seem to get it working.
It could be that it works fine for use on the web but I have to use it in access so...
I'v been reading alot about this and it seems it is no longer supported by microsoft in the .net2 wich really suckes how am I supposed to get my user controls into access now
|
|
|
|
|
TDDragon wrote: I'v been reading alot about this and it seems it is no longer supported by microsoft in the .net2
WHA??? Who told you that?? Attributing a class for COM Interop is very much supported, even into .NET 3.0 and 3.5.
How do you have your class/methods/properties attributed?? Was the resulting .DLL registered on the target machine using REGASM?? Regsrv32 won't work with a .NET assembly.
|
|
|
|
|
when I try to register it on the target machine it gives me an error
as for where or who told me that there was no support I can't really answer that beceause I don't know anymore (I'v been reading articles and blogs all day long and everything is starting to bee very blurry)
I'v added the following to my class:
<Guid("1376DE24-CC2D-46cb-8BF0-887A9CAF3014"), ClassInterface(ClassInterfaceType.AutoDual), ProgId("Preview.PreviewDialog")> Public Class PreviewDialog
...
<ComRegisterFunction()> Public Shared Sub RegisterClass(ByVal key As String)
Dim sb As New StringBuilder(key)
sb.Replace("HKEY_CLASSES_ROOT\", "")
Dim k As RegistryKey = Registry.ClassesRoot.OpenSubKey(sb.ToString(), True)
Dim ctrl As RegistryKey = k.CreateSubKey("Control")
ctrl.Close()
Dim inprocServer32 As RegistryKey = k.OpenSubKey("InprocServer32", True)
inprocServer32.SetValue("CodeBase", Assembly.GetExecutingAssembly().CodeBase)
inprocServer32.Close()
k.Close()
End Sub
<ComUnregisterFunction()> Public Shared Sub UnregisterClass(ByVal key As String)
Dim sb As New StringBuilder(key)
sb.Replace("HKEY_CLASSES_ROOT\", "")
Dim k As RegistryKey = Registry.ClassesRoot.OpenSubKey(sb.ToString(), True)
k.DeleteSubKey("Control", False)
Dim inprocServer32 As RegistryKey = k.OpenSubKey("InprocServer32", True)
k.DeleteSubKey("CodeBase", False)
k.Close()
End Sub
when I build this it seems that he is trying to register it but isn't able to do so for the vbpowerpack.dll so I'm currently writing a simple usercontrol without the vbpowerpack to see if it makes a difference
My control is visible already in the insert add-in menu of access but I get an error when I try to do soo.
I'm currently thinking (hoping) its because of the vbpowerpack
|
|
|
|
|
After creating a very simple user control (contains just a button and checkbox and no code) it would seem that my code above indeed works fine (I can use this user control in access 2003 (still have to find it in 2007 but don't expect much trouble there))
So apperently it was the vbpowerpack that gave me so much trouble
still have to see how I can make access catch events and get property's from my user control but that at least I can get my user control to display on a form already
thanks for the assistence
|
|
|
|
|
please help
i wanna make a code that tell visual basic if the value of ("reglz")= dbnull then
go to err1:
when i type that ,he underline the word dbnull (u can't use it as experision
here is my code
cmd.CommandText = "select sum(fatrq1)reglz from reglz where fatrname = '" + ComboBox1.Text + "'"<br />
'fatrq1<br />
dr = cmd.ExecuteReader<br />
<br />
dr.Read()<br />
<br />
<br />
If f = DBNull Then<br />
GoTo hh<br />
<br />
End If<br />
<br />
f = dr("reglz")<br />
any suggestion ???
|
|
|
|
|
|
|
replace your code with the following
if isdbnull(f) then
goto hh
end if
|
|
|
|
|
I have microsoft fingerprint reader. its SDK from griule.com.
samples provided with SDK are in VB6,VB.NET,C#.NET etc.
but I need samples to work in MS.ACCESS2003.
all work fine when I copied all the code from VB6 to VBA(ms access).
here's what I have to changes.
1). made a public variable to refer to form.(Public frmMain As Form) as VB6 has a form with name(frmMain).
here's what I experience when I call a function.
herers the definition provided in for VB6.
Function CapRawImageToHandle (ByRef RawImage As Variant, ByVal width As Long, ByVal height As Long, ByVal hdc As Long, ByRef handler As IPictureDisp) As Long
'Call to function in VB6
frmMain.ctrl.CapRawImageToHandle raw.img, raw.width, raw.height, frmMain.hDc, handle
I got an error application-defined or object-oriented error.
I guess frmMain.hDC is causing problem as I don't know how to refer to ms access form's hDC property.
Asif Rehman
|
|
|
|
|
I have changes frmMain.hdc to frmMain.hWnd
now it works fine but.
I've got Image Control on form. and want to show the image taken from
handle variable.
' handle to finger image
Dim handle As IPictureDisp
frm.GrFingerXCtrl1.CapRawImageToHandle raw.img, raw.width, raw.height, frm.Hwnd, handle
' draw image on picture box
If Not (handle Is Nothing) Then
formMain.img.Picture = handle
End If
it gives error when I update Image Control(msaccess) in this way.(file not found).
Asif Rehman
|
|
|
|