Sorry for delayed reply.
You should still be able to use the code in your first message in VB6, for example, following code works on my side in a VB6 program:
Function AuthCheck(ByVal sUser As String, ByVal sPassword As String) As Boolean
On Error GoTo E
Dim RootDSE
Dim DSObject
Dim Auth
Dim NamingContext
Const ADS_SECURE_AUTHENTICATION = 1
Set RootDSE = GetObject("GC://rootDSE")
NamingContext = RootDSE.Get("defaultNamingContext")
Set DSObject = GetObject("GC:")
Set Auth = DSObject.OpenDSObject("GC://" & NamingContext, sUser, sPassword, ADS_SECURE_AUTHENTICATION)
Set Auth = Nothing
Set DSObject = Nothing
Set RootDSE = Nothing
AuthCheck = True
Exit Function
E:
AuthCheck = False
' log the err.Description if needed
End Function
Calling AuthCheck("
If you need to use strong-typed objects, you need to reference "Active DS Type Library" in your VB6 project and use those objects accordingly. For example, OpenDSObject is a method of the interface IADsOpenDSObject.
Best regards,
Walter Wang
Microsoft Online Community Support
Showing posts with label vb. Show all posts
Showing posts with label vb. Show all posts
Saturday, December 15, 2007
ad auth in vba
Thursday, December 13, 2007
VBScript Classes
Creating Classes with VBScript
ASP 101 - Articles
DevGuru VBScript Object Class
VBScript in a Nutshell Chapter 2 Program Structure use find 2 search 4 Class Modules
Inside Microsoft Using VBScript Classes in ASP Applications
Creating Classes with VBScript 5.0
misc
JSWare - VBScripts and Components Topic and Function Index
JSWare - MSI - Windows Installer - Code and Utilities
ASP 101 - Articles
DevGuru VBScript Object Class
VBScript in a Nutshell Chapter 2 Program Structure use find 2 search 4 Class Modules
Inside Microsoft Using VBScript Classes in ASP Applications
Creating Classes with VBScript 5.0
misc
JSWare - VBScripts and Components Topic and Function Index
JSWare - MSI - Windows Installer - Code and Utilities
vbscript error numbers w/ try catch class exmpl
try catch class
vbscript error ms page
==============================
Select Case Err
Case 61
sErrMsg = "Disk Full"
Case 71
sErrMsg = "Disk Not Ready"
Case 76
sErrMsg = "Path not found"
Case 70
sErrMsg = "Permission denied"
case else
sErrMsg = Err & " Undefined"
End Select
http://blogs.msdn.com/ericlippert/archive/2004/09/09/227461.aspx
=============================
5 Invalid procedure call or argument 6 Overflow 7 Out of memory 9 Subscript out of range 10 This array is fixed or temporarily locked 11 Division by zero 13 Type mismatch 14 Out of string space 17 Can't perform requested operation 28 Out of stack space 35 Sub or Function not defined 48 Error in loading DLL 51 Internal error 52 Bad file name or number 53 File not found 54 Bad file mode 55 File already open 57 Device I/O error 58 File already exists 61 Disk full 62 Input past end of file 67 Too many files 68 Device unavailable 70 Permission denied 71 Disk not ready 74 Can't rename with different drive 75 Path/File access error 76 Path not found 91 Object variable not set 92 For loop not initialized 94 Invalid use of Null 322 Can't create necessary temporary file 424 Object required 429 ActiveX component can't create object 430 Class doesn't support Automation 432 File name or class name not found during Automation operation 438 Object doesn't support this property or method 440 Automation error 445 Object doesn't support this action 446 Object doesn't support named arguments 447 Object doesn't support current locale setting 448 Named argument not found 449 Argument not optional 450 Wrong number of arguments or invalid property assignment 451 Object not a collection 453 Specified DLL function not found 455 Code resource lock error 457 This key is already associated with an element of this collection 458 Variable uses an Automation type not supported in VBScript 462 The remote server machine does not exist or is unavailable 481 Invalid picture 500 Variable is undefined 501 Illegal assignment 502 Object not safe for scripting 503 Object not safe for initializing 504 Object not safe for creating 505 Invalid or unqualified reference 506 Class not defined 507 An exception occurred32811 Element not found32812 The specified date is not available in the current locale's calendar
vbscript error ms page
==============================
Select Case Err
Case 61
sErrMsg = "Disk Full"
Case 71
sErrMsg = "Disk Not Ready"
Case 76
sErrMsg = "Path not found"
Case 70
sErrMsg = "Permission denied"
case else
sErrMsg = Err & " Undefined"
End Select
http://blogs.msdn.com/ericlippert/archive/2004/09/09/227461.aspx
=============================
5 Invalid procedure call or argument 6 Overflow 7 Out of memory 9 Subscript out of range 10 This array is fixed or temporarily locked 11 Division by zero 13 Type mismatch 14 Out of string space 17 Can't perform requested operation 28 Out of stack space 35 Sub or Function not defined 48 Error in loading DLL 51 Internal error 52 Bad file name or number 53 File not found 54 Bad file mode 55 File already open 57 Device I/O error 58 File already exists 61 Disk full 62 Input past end of file 67 Too many files 68 Device unavailable 70 Permission denied 71 Disk not ready 74 Can't rename with different drive 75 Path/File access error 76 Path not found 91 Object variable not set 92 For loop not initialized 94 Invalid use of Null 322 Can't create necessary temporary file 424 Object required 429 ActiveX component can't create object 430 Class doesn't support Automation 432 File name or class name not found during Automation operation 438 Object doesn't support this property or method 440 Automation error 445 Object doesn't support this action 446 Object doesn't support named arguments 447 Object doesn't support current locale setting 448 Named argument not found 449 Argument not optional 450 Wrong number of arguments or invalid property assignment 451 Object not a collection 453 Specified DLL function not found 455 Code resource lock error 457 This key is already associated with an element of this collection 458 Variable uses an Automation type not supported in VBScript 462 The remote server machine does not exist or is unavailable 481 Invalid picture 500 Variable is undefined 501 Illegal assignment 502 Object not safe for scripting 503 Object not safe for initializing 504 Object not safe for creating 505 Invalid or unqualified reference 506 Class not defined 507 An exception occurred32811 Element not found32812 The specified date is not available in the current locale's calendar
Friday, November 23, 2007
visual_studio_2008
Visual Basic 2008 Express Edition
Beginner Developer Learning Center Overview
Kid's Corner
Visual Studio 2008 the big guy!!
Data Access Tutorials The Official Microsoft ASP.NET Site
Offline Installation
LINQ Videos The Official Microsoft ASP.NET Site
Get Started The Official Microsoft ASP.NET Site
The Official Microsoft ASP.NET Site
Learn The Official Microsoft ASP.NET Site
LINQ Videos The Official Microsoft ASP.NET Site
Dan Fernandez's Blog Top 15 Things to love about Visual Studio 2008 Express
Beginner Developer Learning Center Overview
Kid's Corner
Visual Studio 2008 the big guy!!
Data Access Tutorials The Official Microsoft ASP.NET Site
Offline Installation
LINQ Videos The Official Microsoft ASP.NET Site
Get Started The Official Microsoft ASP.NET Site
The Official Microsoft ASP.NET Site
Learn The Official Microsoft ASP.NET Site
LINQ Videos The Official Microsoft ASP.NET Site
Dan Fernandez's Blog Top 15 Things to love about Visual Studio 2008 Express
Labels:
reading room,
scripts,
tools,
tranining,
vb,
visual_studio_2008
Sunday, July 29, 2007
Subscribe to:
Posts (Atom)