Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pass parameter to cursoradapter vcx include
Message
From
18/01/2005 14:49:51
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
00978162
Message ID:
00978268
Views:
34
>>test is a cursoradapter with a ?cssn in the select
>>
>>SET CLASSLIB TO test additive
>>private oXC
>>oXC = CREATEOBJECT('test')
>>? what here for parameter
>>m.error = oXC.Cursorfill()
>>If !m.error
>>*Wait WINDOW "Upload Failed.  Press a key..."
>>   =Messagebox(Message(),64)
>>Else
>>   brow
>>   oXC.RELEASE()
>>endif
>>return
>>
>>Is this the right way to do this?
>
>
>
>SET CLASSLIB TO test additive
>private oXC
>oXC = CREATEOBJECT('test')
>cssn = ValueForCssn && Do not declare cssn as LOCAL
>m.error = oXC.Cursorfill()
>If !m.error
>   =Messagebox(Message(),64)
>Else
>   brow
>   oXC.RELEASE()
>endif
>return
>
>
>Other way
>
>SET CLASSLIB TO test additive
>private oXC
>oXC = CREATEOBJECT('test', ValueForCssn)
>m.error = oXC.Cursorfill()
>If !m.error
>   =Messagebox(Message(),64)
>Else
>   brow
>   oXC.RELEASE()
>endif
>return
>
>
>but If You use that method in Init Event of the CA You must have PARAMETER named cssn

Ok that is what I thought. Must have something wrong in my ca
* from autoopen
*** Setup code: DO NOT REMOVE
if not pemstatus(This, '__VFPSetup', 5)
	This.AddProperty('__VFPSetup', 1)
	This.Init()
endif
*** End of Setup code: DO NOT REMOVE
**from init
local llReturn
do case
	case not pemstatus(This, '__VFPSetup', 5)
		This.AddProperty('__VFPSetup', 0)
	case This.__VFPSetup = 2
		This.__VFPSetup = 0
		return
endcase
llReturn = dodefault()
*** Select connection code: DO NOT REMOVE
local loConnDataSource
set multilocks on
loConnDataSource = createobject('ADODB.Connection')
***<DataSource>
loConnDataSource.ConnectionString = [Provider=SQLOLEDB.1;Password=T?;Persist Security Info=True;User ID=T?] + ;
	[;Initial Catalog=TEAL;Data Source=local;]
***</DataSource>
loConnDataSource.Open()
This.DataSource = createobject('ADODB.RecordSet')
This.DataSource.CursorLocation   = 3  && adUseClient
This.DataSource.LockType         = 3  && adLockOptimistic
This.DataSource.ActiveConnection = loConnDataSource
*** End of Select connection code: DO NOT REMOVE
*** Setup code: DO NOT REMOVE
***<SelectCmd>
text to This.SelectCmd noshow
select teacher.* from teacher WHERE ssn = ?cssn ORDER BY ssn
endtext
***</SelectCmd>
***<KeyFieldList>
text to This.KeyFieldList noshow
SSN
endtext
***</KeyFieldList>
***<UpdateNameList>
text to This.UpdateNameList noshow
SSN teacher.SSN, LAST_NAME teacher.LAST_NAME, FIRST_NAME teacher.FIRST_NAME, MID_NAME teacher.MID_NAME, ADDRESS1 teacher.ADDRESS1, ADDRESS2 teacher.ADDRESS2, CITY teacher.CITY, STATE teacher.STATE, ZIP_CODE teacher.ZIP_CODE, BIRTH_DATE teacher.BIRTH_DATE, PHONE teacher.PHONE, WRKPHONE teacher.WRKPHONE, GENDR_CODE teacher.GENDR_CODE, EX_CHILD teacher.EX_CHILD, SC_EXEMPT teacher.SC_EXEMPT, READING teacher.READING, PK_SCORE teacher.PK_SCORE, READ_SCORE teacher.READ_SCORE, WRIT_SCORE teacher.WRIT_SCORE, MATH_SCORE teacher.MATH_SCORE, STATUS teacher.STATUS, STAT_DATE teacher.STAT_DATE, EDIT_BY teacher.EDIT_BY, EDIT_DATE teacher.EDIT_DATE, EDIT_TIME teacher.EDIT_TIME, PRIOR_NAME teacher.PRIOR_NAME, LABEL1 teacher.LABEL1, LABEL2 teacher.LABEL2, PACKET_ID teacher.PACKET_ID, MASTERS teacher.MASTERS, FEE_AMOUNT teacher.FEE_AMOUNT, BADCHECK teacher.BADCHECK, KBI_CHKD teacher.KBI_CHKD, PLT_SCORE teacher.PLT_SCORE
endtext
***</UpdateNameList>
***<UpdatableFieldList>
text to This.UpdatableFieldList noshow
SSN, LAST_NAME, FIRST_NAME, MID_NAME, ADDRESS1, ADDRESS2, CITY, STATE, ZIP_CODE, BIRTH_DATE, PHONE, WRKPHONE, GENDR_CODE, EX_CHILD, SC_EXEMPT, READING, PK_SCORE, READ_SCORE, WRIT_SCORE, MATH_SCORE, STATUS, STAT_DATE, EDIT_BY, EDIT_DATE, EDIT_TIME, PRIOR_NAME, LABEL1, LABEL2, PACKET_ID, MASTERS, FEE_AMOUNT, BADCHECK, KBI_CHKD, PLT_SCORE
endtext
***</UpdatableFieldList>
*** End of Setup code: DO NOT REMOVE
if This.__VFPSetup = 1
	This.__VFPSetup = 2
endif
return llReturn
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform