Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid Array of Validity Check Descriptors

Status
Not open for further replies.

soks2626

Programmer
Jul 3, 2002
22
US
I don't know what to do! I'm just trying to add one new field to the end of the table but when i get to the table.restructure command, it gives me that error. Any suggestions? HEre's the code.

-Alex

method run(var eventInfo Event)
addpassword("peterpiper")
tbl.attach( ":CLIENT:CLIENT.DB" )
tbl.unlock("Full")
tbl.enumFieldStruct( ":pRIV:field_struct.db" )

tcFlds.open(":pRIV:field_struct.db" )
tcFlds.edit()

;//add a field Test2 at the end of table
tcFlds.end()
tcFlds.insertAfterRecord()
tcFlds.(1) = "URL" ;field name
tcFlds.(2) = "ALPHA" ;field type
tcFlds.(3) = 30 ;size
tcFlds.(4) = 0

tcFlds.endEdit()
tcFlds.close()

dynNewStru["FIELDSTRUCT"] = ":pRIV:field_struct.db"

if tbl.restructure(dynNewStru) then
msginfo("Yay", 1)
endif

endMethod
 
Try adding the following line after tcFlds.(4) = 0

tcFlds.postRecord()
tcFlds.(tcFlds.nFields()) = tcFlds.nRecords()

It would probably be better to refer to the fields by their descriptions, e.g. instead of tcFlds.(1) use tcFlds."Field Name" etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top