Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorAdapter Class & Fox Tables
Message
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01461068
Message ID:
01461075
Views:
78
>>I have a cursoradapter class (in a vcx file) that i use to access fox tables and i have a problem when inserting a new record. I try to explain my problem: i create my object, i browse data and i have no problems, i modify a record and i have no problem; i insert a new record, i compile the code field and i left the others field empty and when i move the pointer to another record (i have autoupdate enabled with record buffering) i receive a message error where i have to cancel or revert; if i select revert my new record is deleted; but now if i try to insert another new record i have no problems and the record and many other are correctly inserted.....It seems that i have to do a tablerevert to have the possibility to append new records.....The table where i work is attacched to a database container and for all fields i have a default value so i have not .null. values for fields not compiled...
>>Someone have suggestions....or can tell me where is mt error....
>>Thanks
>
>Can you post your CA's code?
DEFINE CLASS clifor AS cursoradapter


	Tag = ['Provider=VFPOLEDB.1;Data Source=C:\Programmi\ApprodoGlobe\Aziende\Acut;Mode=ReadWrite;Password="";Collating Sequence=MACHINE;']
	Height = 22
	Width = 23
	SelectCmd = "select * from test4"
	CursorSchema = "    1330CODE C(6), RAS1 C(40), INDI C(40), LOCA C(40), CAP I, PROV C(2), STAT C(3), PCON C(40), CFIS C(16), PIVA Y, TEL1 C(15), TEL2 C(15), CELL C(15), TFAX C(15), MAIL C(50), ABI I, CAB I, CTCO C(15), CPAG C(3), NSPE N(2, 0), ZONA C(3), DIKM I, DIHO N(5, 1), CTVE I, CTRI I, CIVA C(3), LETT C(10), DLET D, PROT C(10), DPRO D, CAGE C(3), DIVI C(3), TRAS C(3), VETT C(3), CDES C(6), PORT C(3), SETT C(3), CATE C(3), LIST C(3), PLIS C(3), SCO1 N(5, 1), SCO2 N(5, 1), PAGE N(5, 1), MES1 N(3, 0),"
	MES2 N(3, 0), SDAY N(3, 0), ALARM C(40), LBLO L, LMOV L, TFATT C(3), TRAT C(1), INTE C(1), DAT1 D, DAT2 D, FIDO I, CONF M, COMM M, ASS M, RICO N(3, 0), RICS N(3, 0), RICA N(3, 0), RICM N(4, 0), FIL2 Y, FIL3 C(10), FIL4 C(10), FIL5 C(3), FIL6 C(2), PPR N(3, 0), CEE C(2), FOL C(40), CIN C(1), CBIC C(34), CCP C(15), CIFA C(6), CINT C(6), COR Y, IBAN C(34), IWEB C(50), LFA L, NAL Y, NAP Y, NOP Y, NTE Y, PPG Y, PR1 C(40), PR2 C(40), PR3 C(40), RCP C(30), GCRI N(4, 0), SOSP L, NLIN N(2, 0), NOFT L, EAN C(7), ACTI C(3), CEVE C(3), CORA C(6), DAAZ D, DEAL C(3), PROM C(3), SCAT C(3), TEL3 C(15), TIPO C(1), CCLA C(2), EVID I, UEID I, FOLDER C(40), IMP L, LDA L, NAT L, STI L, LUP T, ARS L, PWD C(15), TIPP N(2, 0), UML C(50), UPD L, USR C(20), DAT5 D, SITU C(2), DNAS D, LNAS C(40), SES C(1), RSR C(30), REGI C(3), CLAS C(1), RIV C(20), CCAP C(10)
	Alias = "test4"
	DataSourceType = "ADO"
	Flags = 0
	KeyFieldList = "CODE"
	Tables = "test4"
	UpdatableFieldList = "     730CODE, RAS1, INDI, LOCA, CAP, PROV, STAT, PCON, CFIS, PIVA, TEL1, TEL2, CELL, TFAX, MAIL, ABI, CAB, CTCO, CPAG, NSPE, ZONA, DIKM, DIHO, CTVE, CTRI, CIVA, LETT, DLET, PROT, DPRO, CAGE, DIVI, TRAS, VETT, CDES, PORT, SETT, CATE, LIST, PLIS, SCO1, SCO2, PAGE, MES1, MES2, SDAY, ALARM, LBLO, LMOV, TFATT, TRAT, INTE, DAT1, DAT2, FIDO, CONF, COMM, ASS, RICO, RICS, RICA, RICM, FIL2, FIL3, FIL4, FIL5, FIL6, PPR, CEE, FOL, CIN, CBIC, CCP, CIFA, CINT, COR, IBAN, IWEB, LFA, NAL, NAP,"
	NOP, NTE, PPG, PR1, PR2, PR3, RCP, GCRI, SOSP, NLIN, NOFT, EAN, ACTI, CEVE, CORA, DAAZ, DEAL, PROM, SCAT, TEL3, TIPO, CCLA, EVID, UEID, FOLDER, IMP, LDA, NAT, STI, LUP, ARS, PWD, TIPP, UML, UPD, USR, DAT5, SITU, DNAS, LNAS, SES, RSR, REGI, CLAS, RIV, CCAP
	UpdateNameList = "    2097CODE test2.code, RAS1 test2.ras1, INDI test2.indi, LOCA test2.loca, CAP test4.CAP, PROV test4.PROV, STAT test4.STAT, PCON test4.PCON, CFIS test4.CFIS, PIVA test4.PIVA, TEL1 test4.TEL1, TEL2 test4.TEL2, CELL test4.CELL, TFAX test4.TFAX, MAIL test4.MAIL, ABI test4.ABI, CAB test4.CAB, CTCO test4.CTCO, CPAG test4.CPAG, NSPE test4.NSPE, ZONA test4.ZONA, DIKM test4.DIKM, DIHO test4.DIHO, CTVE test4.CTVE, CTRI test4.CTRI, CIVA test4.CIVA, LETT test4.LETT, DLET test4.DLET, PROT"
	test4.PROT, DPRO test4.DPRO, CAGE test4.CAGE, DIVI test4.DIVI, TRAS test4.TRAS, VETT test4.VETT, CDES test4.CDES, PORT test4.PORT, SETT test4.SETT, CATE test4.CATE, LIST test4.LIST, PLIS test4.PLIS, SCO1 test4.SCO1, SCO2 test4.SCO2, PAGE test4.PAGE, MES1 test4.MES1, MES2 test4.MES2, SDAY test4.SDAY, ALARM test4.ALARM, LBLO test4.LBLO, LMOV test4.LMOV, TFATT test4.TFATT, TRAT test4.TRAT, INTE test4.INTE, DAT1 test4.DAT1, DAT2 test4.DAT2, FIDO test4.FIDO, CONF test4.CONF, COMM test4.COMM, ASS test4.ASS, RICO test4.RICO, RICS test4.RICS, RICA test4.RICA, RICM test4.RICM, FIL2 test4.FIL2, FIL3 test4.FIL3, FIL4 test4.FIL4, FIL5 test4.FIL5, FIL6 test4.FIL6, PPR test4.PPR, CEE test4.CEE, FOL test4.FOL, CIN test4.CIN, CBIC test4.CBIC, CCP test4.CCP, CIFA test4.CIFA, CINT test4.CINT, COR test4.COR, IBAN test4.IBAN, IWEB test4.IWEB, LFA test4.LFA, NAL test4.NAL, NAP test4.NAP, NOP test4.NOP, NTE test4.NTE, PPG test4.PPG, PR1 test4.PR1, PR2 test4.PR2, PR3 test4.PR3, RCP test4.RCP, GCRI test4.GCRI, SOSP test4.SOSP, NLIN
	test4.NLIN, NOFT test4.NOFT, EAN test4.EAN, ACTI test4.ACTI, CEVE test4.CEVE, CORA test4.CORA, DAAZ test4.DAAZ, DEAL test4.DEAL, PROM test4.PROM, SCAT test4.SCAT, TEL3 test4.TEL3, TIPO test4.TIPO, CCLA test4.CCLA, EVID test4.EVID, UEID test4.UEID, FOLDER test4.FOLDER, IMP test4.IMP, LDA test4.LDA, NAT test4.NAT, STI test4.STI, LUP test4.LUP, ARS test4.ARS, PWD test4.PWD, TIPP test4.TIPP, UML test4.UML, UPD test4.UPD, USR test4.USR, DAT5 test4.DAT5, SITU test4.SITU, DNAS test4.DNAS, LNAS test4.LNAS, SES test4.SES, RSR test4.RSR, REGI test4.REGI, CLAS test4.CLAS, RIV test4.RIV, CCAP test4.CCAP
	ConversionFunc = ""
	Name = "clifor"


	PROCEDURE Init
		*** Setup code: DO NOT REMOVE
		local llReturn
		do case
			case not pemstatus(This, '__VFPSetup', 5)
				This.AddProperty('__VFPSetup', 0)
			case This.__VFPSetup = 1
				This.__VFPSetup = 2
			case This.__VFPSetup = 2
				This.__VFPSetup = 0
				return
		endcase
		set multilocks on
		llReturn = dodefault()
		*** End of Setup code: DO NOT REMOVE
		*** Select connection code: DO NOT REMOVE

		local loConnDataSource
		loConnDataSource = createobject('ADODB.Connection')
		***<DataSource>
		loConnDataSource.ConnectionString = [Provider=VFPOLEDB.1;Data Source=C:\Programmi\ApprodoGlobe\Aziende\Acut;Mod] + ;
			[e=ReadWrite;Password="";Collating Sequence=MACHINE;]
		***</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
		if This.__VFPSetup = 1
			This.__VFPSetup = 2
		endif
		return llReturn
		*** End of Setup code: DO NOT REMOVE
	ENDPROC


	PROCEDURE 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
	ENDPROC


ENDDEFINE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform