Home > Archive > dBASE Web Applications > April 2005 > appending a new row









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author appending a new row
Dan Anderson

2005-04-04, 8:03 pm

DB+ I'm having trouble with appending a new row. The following code
results in an error 163 (expecting character) in WebClass.cc line 754
routine:loadfieldsfr
omarray. I can't figure out what it doesn't like. Can
anyone help?



_app.errorAction = 3

set proc to WebClassEx.cc additive
oCGI = new CGISessionEx()
oCGI.Connect()

d= new database()
d.databaseName = "dUBI"
d.active = true

q = new query()
q.database := d
q.sql = 'select * from "units.dbf"'
q.active = true

for i=1 to q.rowset.fields.size
cFieldName = q.rowset.fields[i].fieldname
oCGI[cFieldName]=""
next

// populate array with fields from query
oCGI. LoadArrayFromFields(
q.rowset.fields)

Local cQuoteNum, cPR, cIName
cQuoteNum = oCGI["QuoteNum"]
cPR = oCGI["PR"]
cIname = oCGI["IName"]
oCGI["Unit"]=1
oCGI["DateAdded"]= date()

// populate units table with known values
oCGI. loadFieldsFromArray(
q.rowset.fields, true)


--
Dan Anderson
UBI Processing Dept.
andersond@ubinc.com
800-444-4824 ext 101


Michael Nuwer [dBVIPS]

2005-04-04, 8:03 pm

Dan Anderson wrote:
> DB+ I'm having trouble with appending a new row. The following code
> results in an error 163 (expecting character) in WebClass.cc line 754
> routine:loadfieldsfr
omarray. I can't figure out what it doesn't like. Can
> anyone help?
>


That line is taking a value from the ocgi array and putting it into one
of the table fields. The field is a character or memo field. The error
suggests that the data in the ocgi array is something other than a
character, like a number or a date.


--
Michael Nuwer
http://www.ChelseaData.ca/dLearn/
http://www.nuwermj.potsdam.edu/dSamples/
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com