Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help - CursorAdapter to Active Directory returning memos
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00932675
Message ID:
00932916
Views:
21
Okay, I went into the VFP CA builder and wiped out the Select Command. I did leave the Schema information there.

I then removed the code from the CA's Init() Method and placed the following in the CursorFill() Method.
LPARAMETERS luseCursorSchema, lNoData, nOptions, Source

TRY
lWasError = .F.
WAIT WINDOW NOWAIT "Connecting to SQL-Server via ADO..."

local loConnDataSource
set multilocks on
loConnDataSource = createobject('ADODB.Connection')

loConnDataSource.ConnectionString = [Provider=ADsDSOObject;Password=mypassword;User ID=myuser;Encrypt Passw] + ;
	[ord=True;Data Source="LDAP://server.domain.com/dc=domain,dc=com";Mode=Read;Bind] + ;
	[ Flags=0;ADSI Flag=-2147483648;]

loConnDataSource.Open()
This.DataSource = createobject('ADODB.RecordSet')
This.DataSource.CursorLocation   = 3  && adUseClient
This.DataSource.LockType         = 3  && adLockOptimistic
This.DataSource.ActiveConnection = loConnDataSource

This.SelectCmd = [select distinguishedname, sn, givenname, employeeid from 'LDAP://server.domain.com/dc=domain,dc=com' where objectCategory='Person' and objectClass='User' and sn='*']

WAIT CLEAR
CATCH
	WAIT CLEAR
	lWasError = .T.
ENDTRY	

IF lWasError 
	RETURN .F.
ELSE
	return dodefault(.T., lNoData, nOptions, loConnDataSource)
ENDIF
It still seems to disregard my schema and I wind up with all memo fields.

Maybe I just need to drop the VFP CA and look at yours, eh? <g>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform