Here is the full script. I had emptied all of the fields in case there might be data there causing the problem. However, the other script above does work to submit all of these fields.
Code: Select all
on mouseUp
Answer "Connected to the Internet and ready to submit?" with "Yes" or "No"
if it ="Yes" then
Open DB code into dbresult
if dbresult is a number then
put dbresult into dbID
else
answer dbResult
end if
--put "INSERT INTO InitialData VALUES (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,:15,:16,:17,:18,:19,:20,:21,:22,:23,:24,:25,:26,:27,:28,:29,:30,:31,:32)" into dbSQL --no spaces
put "INSERT INTO InitialData VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20, :21, :22, :23, :24, :25, :26, :27, :28, :29, :30, :31, :32)" into dbSQL --spaces added
put field "Subject" of card "MainData1" into dbData[1]
put field "SubmitTime" of card "MainData1" into dbData[2]
put field "SubmitDate" of card "MainData1" into dbData[3]
put field "Summary" of card "MainData1" into dbData[4]
put field "NumberOfEraser" of card "MainData1" into dbData[5]
put field "NumberOfPencil" of card "MainData1" into dbData[6]
put field "ToolChoice" of card "MainData1" into dbData[7]
put field "PencilSpent" of card "MainData1" into dbData[8]
put field "ToolSwitch" of card "MainData1" into dbData[9]
put field "EraserSpent" of card "MainData1" into dbData[10]
put field "StartTime" of card "MainData1" into dbData[11]
put field "TimeSeq" of card "MainData1" into dbData[12]
put field "NumbersOfTitleCorrection" of card "MainData1" into dbData[13]
put field "Titles" of card "MainData1" into dbData[14]
put field "CompleteDraw" of card "MainData1" into dbData[15]
put field "Age" of card "MainData1" into dbData[16]
put field "Ratings" of card "Data1" into dbData[17]
put field "RatingsF" of card "Data1" into dbData[18]
set the itemDelimiter to tab
put item 2 of line 1 of field "RatingsF" of card "Data1" into dbData[19]
put item 2 of line 2 of field "RatingsF" of card "Data1" into dbData[20]
put item 2 of line 3 of field "RatingsF" of card "Data1" into dbData[21]
put item 2 of line 4 of field "RatingsF" of card "Data1" into dbData[22]
put item 2 of line 5 of field "RatingsF" of card "Data1" into dbData[23]
put item 2 of line 6 of field "RatingsF" of card "Data1" into dbData[24]
put item 2 of line 7 of field "RatingsF" of card "Data1" into dbData[25]
put item 2 of line 8 of field "RatingsF" of card "Data1" into dbData[26]
put item 2 of line 9 of field "RatingsF" of card "Data1" into dbData[27]
put item 2 of line 10 of field "RatingsF" of card "Data1" into dbData[28]
put item 2 of line 11 of field "RatingsF" of card "Data1" into dbData[29]
put item 2 of line 12 of field "RatingsF" of card "Data1" into dbData[30]
put item 2 of line 13 of field "RatingsF" of card "Data1" into dbData[31]
put item 2 of line 14 of field "RatingsF" of card "Data1" into dbData[32]
put image "ImageDrawing" of card "Activity1" into dbData["*b33"]
revExecuteSQL dbID, dbSQL, "dbData"
if last char of dbSQL = ";" then delete last char of dbSQL
revExecuteSQL dbID, dbSQL
put the result into sqlResult
if sqlResult is a number then
answer "Query OK: " & sqlResult & " record(s) altered." with "OK"
else
answer sqlResult with "OK"
end if
end if
end mouseUp