PC Review


Reply
Thread Tools Rate Thread

complication between VB syntax and Object Value with [-] minus character

 
 
Eldi Munggaran
Guest
Posts: n/a
 
      8th Apr 2007
I'm trying to fetch data from "Active Directory",
the process are :

strQuery = "SELECT AdsPath FROM
'LDAP://ou=xxx,ou=yyy,ou=zzz,dc=ct,dc=abcdefg,dc=net'"
objCommand.CommandText = strQuery
Set objRecordSet = objCommand.Execute
Set objUser = GetObject(objRecordSet.Fields("AdsPath").Value)

Do Until objRecordSet.EOF
formMain.lbstatus.Caption = "Fetching data " & i - 4 & " of " &
objRecordSet.RecordCount
formMain.Repaint
Set objUser = GetObject(objRecordSet.Fields("AdsPath").Value)
ThisWorkbook.ActiveSheet.Cells(i, 3).Value = objUser.cn ' NICK USER NAME
ThisWorkbook.ActiveSheet.Cells(i, 4).Value =
objUser.displayName'LOGIN NAME
ThisWorkbook.ActiveSheet.Cells(i, 5).Value = objUser.sn 'LAST NAME
ThisWorkbook.ActiveSheet.Cells(i, 6).Value = objUser.Title 'TITTLE
ThisWorkbook.ActiveSheet.Cells(i, 7).Value = objUser.mail ' EMAIL Address
ThisWorkbook.ActiveSheet.Cells(i, 8).Value = objUser.msExchIMAddress'
im MAIL Address
ThisWorkbook.ActiveSheet.Cells(i, 9).Value =
objUser.cvx-SourcingCompany 'SourcingCompany

objRecordSet.MoveNext
i = i + 1
Loop



The problem happen when I'm trying to fetch cvx-SourcingCompany, it's
seems like complication between VB syntax and Object Value when using
character "-" that VB think objectUser.cvx [minus] SourcingCompany.

Any Suggestion ?
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Syntax Error: Japanese Character in VBA Editor david Microsoft Access VBA Modules 0 30th May 2010 03:49 AM
Plus or minus character ...Its ASCII value Srinivasulu B Microsoft Excel New Users 6 20th Sep 2009 06:44 AM
SYNTAX, FORMAT "PLUS OR MINUS" =?Utf-8?B?Ri4gTGF3cmVuY2UgS3VsY2hhcg==?= Windows XP General 4 22nd Nov 2006 10:38 PM
Opening office documents - minus application object Irwin Williams Microsoft Access VBA Modules 1 12th Jan 2005 07:08 PM
Getting Syntax error converting from a character string to uniqueidentifier Roy Rodsson via .NET 247 Microsoft VB .NET 2 23rd Apr 2004 10:33 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:21 PM.