General information
Category:
Database DAO/RDO/ODBC/ADO
Title:
Reslutset is readonly Opps wrong code
This is the correct code...
Set mrdoEnv = rdoEnvironments(0)
Set mrdoConn = mrdoEnv.OpenConnection("GITSDEV", rdDriverNoPrompt, False, "ODBC;UID=sa;PWD=")
'Select Statement to populate form, this may have to be modified for speed.
sSQL = _
"SELECT member.* " _
& "FROM member " _
& "ORDER BY member.lastname ASC;"
Set mrdoRS = mrdoConn.OpenResultset(sSQL, rdOpenKeyset, rdConcurRowver)
mrdoRS.MoveFirst
SetRecNum
DataLoad
End Sub
This is the edit procedure...
Private Sub DataSave()
mrdoRS.Edit
mrdoRS("Address1") = txtAddress1.Text
mrdoRS("Address2") = txtAdd2.Text
mrdoRS("SSN") = txtSSN.Text
mrdoRS("Lastname") = txtLastname.Text
mrdoRS("Firstname") = txtFirstname.Text
mrdoRS("Middlename") = txtMiddle.Text
mrdoRS("Salutation") = txtSalutation.Text
mrdoRS("Suffix") = txtSuffix.Text
mrdoRS("BirthDate") = txtBirthdate.Text
mrdoRS("Gender") = txtGender.Text
mrdoRS("City") = txtCity.Text
mrdoRS("State") = txtState.Text
mrdoRS("Zip") = txtZip.Text
mrdoRS("County") = txtCounty.Text
mrdoRS("homephone") = mskHomephone.Text
mrdoRS("workphone") = mskWorkPhone.Text
mrdoRS("workexten") = txtWorkExten.Text
mrdoRS.Update
'Error Trapping
On Error GoTo DataSaveError
mrdoRS.Update
mDirty = False
Exit Sub
DataSaveError:
frmRDOErrors.ErrorColl = rdoErrors
End Sub
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only