M
Martin Williams
Still working out a few bugs in a survey program I'm writing. The way I
have it configured is as each survey is completed, the dataset is updated.
When the program is closed, the database itself is updated. However, when I
check the database table, there are some answers that are duplicated two and
three times.
Here are some snippets...(VB.NET, 1.1)
//This sub is called on the last page of the survey when the "Finish" button
is clicked.
Sub GatherAndUpdateAnswers()
//there is some code before this that gathers all the answers and assigns
them to variables
dim newrecord as datarow = mainform.dssurveydata1.survey_data.newrow
newrecord(0) = QuestionOneAnswer
newrecord(2) = QuestionTwoAnswer
//repeats like this until twelve
mainform.dssurveydata1.survey_data.rows.add(newrecord)
end sub
Sub UpdateData()
dim pdsInsertedRows as system.data.dataset
pdsInsertedRows = mainform.dssurvey_data1.getchanges(datarowstate.added)
mainform.oledbdataadapter1.update(pdsInsertedRows)
end sub
Private Sub Form1_Closing(...)
Call UpdateData()
end sub
When the "Finish" button is clicked on the last form,
GatherAndUpdateAnswers() is called.
Another problem I am having is Access cutting off some of the fields that
require longer answers. I have these fields set to "Memo" in Access, but
it's still cutting off after 255 characters. Any idea on how to correct
this? Thanks for all responses.
have it configured is as each survey is completed, the dataset is updated.
When the program is closed, the database itself is updated. However, when I
check the database table, there are some answers that are duplicated two and
three times.
Here are some snippets...(VB.NET, 1.1)
//This sub is called on the last page of the survey when the "Finish" button
is clicked.
Sub GatherAndUpdateAnswers()
//there is some code before this that gathers all the answers and assigns
them to variables
dim newrecord as datarow = mainform.dssurveydata1.survey_data.newrow
newrecord(0) = QuestionOneAnswer
newrecord(2) = QuestionTwoAnswer
//repeats like this until twelve
mainform.dssurveydata1.survey_data.rows.add(newrecord)
end sub
Sub UpdateData()
dim pdsInsertedRows as system.data.dataset
pdsInsertedRows = mainform.dssurvey_data1.getchanges(datarowstate.added)
mainform.oledbdataadapter1.update(pdsInsertedRows)
end sub
Private Sub Form1_Closing(...)
Call UpdateData()
end sub
When the "Finish" button is clicked on the last form,
GatherAndUpdateAnswers() is called.
Another problem I am having is Access cutting off some of the fields that
require longer answers. I have these fields set to "Memo" in Access, but
it's still cutting off after 255 characters. Any idea on how to correct
this? Thanks for all responses.