Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot update the recordset
Message
De
19/05/1999 20:16:15
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Cannot update the recordset
Divers
Thread ID:
00220657
Message ID:
00220657
Vues:
51
Consider the following code:

SET cn = Server.CreateObject("ADODB.Connection")
cn.Open "JES"

IF Request.Form("cboDivisions") > "" AND _
Request.Form("txtInitials") > "" AND _
Request.Form("txtDateTaken") > "" AND _
Request.Form("txtKeyEntryDate") > "" AND _
Request.Form("cboMonthProcessed") > "" THEN

rs.CursorType = adOpenKeySet
rs.LockType = adLockPessimistic
SET rs = cn.Execute( _
"SELECT * FROM Journal_Types WHERE name= '" &_
Session("JournalType") & "'" )
IF rs.EOF THEN
EXIT SUB
END IF

counter = rs("count")
counter = counter + 1
rs("count") = counter
rs.Update
rs.Close

*** NOTE: The count field is not getting updated here



rs.LockType = adLockOptimistic
SET rs = cn.Execute( _
"SELECT * FROM Journal_Types WHERE name= '" &_
Session("JournalType") & "'" )

Session("JournalCode") = rs("code")
nEntry = rs("count")
cEntry = Session("JournalCode") & Request.Form("cboDivisions") & rs("count")
Session("JournalCode") = rs.code

cn.Execute "INSERT INTO Entries " &_
"(EntryNumber, Division, Initials, DateTaken, KeyEntryDate, MonthProcess) " &_
"VALUES (cEntry, " &_
"'" & Request.Form("cboDivisions") & "', " &_
"'" & Request.Form("txtInitials") & "', " &_
"'" & Request.Form("txtDateTaken") & "', " &_
"'" & Request.Form("txtKeyEntryDate") & "', " &_
"'" & Request.Form("cboMonthProcessed") & "' ) "

*** NOTE: Record is not getting added here.......

Q: Is there something I am missing????

Thanks in advance for any help.
Michael
Répondre
Fil
Voir

Click here to load this message in the networking platform