-
Wrong record on form (when new records have been added)
My application has 7-8 users adding records to a database. If they need to edit a record, they click on the record number in the grid. It goes to a form with the record detail where they can click on an Edit button to change the record.
When a user clicks on his record to edit, he sometimes does not get his record but another record. This happens if other users have entered new records in the time between the grid display and the click to get the form field. Is there any way to fix this besides refreshing the screen quickly so no one adds a new record before I try to edit one after displaying the grid?
Why isn't the record id (key) passed instead of the relative record reference?
tscalls.asp?aspDBBut_999=aspDBgoForm::5
(ASPdb Enterprise version
<html>
<HEAD>
<TITLE>Technical Service Calls</TITLE>
</HEAD>
<!--#include file=dbconn.inc-->
<!--REQUIRED for CUSTOM TEXT! -->
<!--#include virtual="/aspdb/AspDB.Inc" -->
<body>
<B>Technical Service Call Log</B>
<TABLE Border=0><TR><TD valign=top align="left">
<%' Create the ASP-db™ object:
Set MyDb = Server.CreateObject("ASP.db"
MyDb.dbDAT = str1 ' Connect
dbUnit = 80
' background, foreground, headerbg, headerfg, vstripe
MyDb.dbColor = "white,black,89B5BC,black,CCDADD"
MyDb.dbMode = "Grid"
MyDb.dbGridTableTag="border=3 style=font-size:12 width=500" ' table attributes
MyDb.dbFormTableTag = "border=3 width=300 style=font-size:12 cellspacing=2 cellpadding=2 "
'Select which Table and Fields to show:
MyDb.dbDBType = "SQL"
MyDb.dbSQL = "Select * from TechServiceCalls Order By Timestamp desc"
MyDb.dbGridInc = 10
MyDb.dbSuppressMsg = False
MyDb.dbFilterParams = "UseRSFilter=False, TableTag=Border=3, Assistant=False, Help=False, TextBeforeTable=<b>Please select search criteria and click the Apply Filter button.<br>You can select more than one field for your search.</b><br>"
MyDb.dbGridIndex=False
MyDb.dbButtonAnchor = False
GMAP = "0,Ref #;Username, Associate; Timestamp, Date/Time;Minutes,Mins"
MyDb.dbNameMap = GMAP
FMAP = "Username, Associate; Timestamp, Date/Time;"
MyDb.dbFormNameMap = FMAP
Mydb.dbMemoTextSize="500"
MyDb.dbImageDir="/ASPdb/images/"
'All navigation items, change these as needed depending on screen displayed
MyDb.dbNavigationItem = "Next,Prev,Add,Edit,Filter,ResetFilter"
MyDb.dbNavigation = "top"
MyDb.dbNavigationIcon="std"
'---------------------------------------------------------------------------
' define add/update parameters
MyDb.dbEditParams = "TableName=TechServiceCalls,BookMarkFlds=ID "
Mydb.dbEditDropFlds = "Product,,,Voyager/Voyager Commercial/Odyssey/Precedent/IntelliPak/Large" &_
"Splits/Chillers/Diversified Products/Other;" &_
"SaleType,,,Post Sale/Pre Sale/Both;" &_
"CallType,,,Trane Service/CSO/DSO/IWD/ICS/Contractor/Parts/End user/International/Latin America/;"
' no edit on add for these fields
MyDb.dbEditAddROFlds = "ID,TimeStamp, Username"
'format for form
MyDb.dbEditFlds = "Caller, CallType, SaleType, Minutes, Comments, " &_
"Username[" & Session("sUsername" & "]," &_
"TimeStamp[" & now() & "]"
MyDb.dbGridDisplayFlds="0,1,2,5,10,12"
MyDb.dbFormDisplayFlds="0,1,2,4,5,6,10,12"
MyDb.dbFilterFlds="0,1,2,4,5,6,10,12"
MyDb.dbFormMagicCell = "Minutes, align=right width=20; " &_
"Comments,,<TEXTAREA Rows=3 COLS=60 style='font-size:12'>#Comments# </TEXTAREA>;" &_
"Timestamp,,Format=[mm/dd/yy hh:mm]"
MyDb.dbMagicCell = "ID,width=8% align=right,,index;Minutes, align=right width=20;Timestamp,width=80,Format=[mm/dd/yy hh:mm];" &_
"Caller,width=20%;" &_
"Username,width=10%"
MyDb.dbButtonsOnOff="EditDropOff" ' remove button to turn off dropdowns
' Specify Column Titles
MyDb.dbFldsNotes = "Minutes,Enter call length in Minutes; Comments,Text will auto wrap"
MyDb.dbEditHeader = False
LBUTTON = UCASE(Request("ASPdbClick_999")
'response.write ("x" & lbutton & " button clicked<br>" )
MyDb.dbUserLocalText = zAddhead & ",<br><b>Add a New Record</b>; "
if ucase(left(request("aspDBBut_999",11)) = "ASPDBGOFORM" then
MyDb.dbNavigationItem = "Edit"
MyDb.dbNavigation = "bottom"
Response.write ("Back to <a href='tscalls.asp?aspDBBut_999=aspDBgridTop 9;>Main Page</a>"
else
if (LBUTTON = "FILTER" then
' MyDb.dbNameMap = "1,Date/Time;Minutes,Mins;"
Response.write ("Back to <a href='tscalls.asp?aspDBBut_999=aspDBgridTop 9;>Main Page</a>"
elseif (LBUTTON = "ADD" or LBUTTON = "APPLYADD" or LBUTTON = "EDIT" then
Response.write ("Back to <a href='tscalls.asp?aspDBBut_999=aspDBgridTop 9;>Main Page</a>"
elseif (LBUTTON = "DELETE" then
Response.write("Delete record <p>"
else
MyDb.dbNavigationItem = "Next,Prev,Add,Filter,ResetFilter"
Response.write("Click the Reference Number for call details<p>"
MyDb.dbNameMap = "0,Ref #;Username, Associate; Timestamp, Date/Time;Minutes,Mins"
end if
end if
MyDb.ASPdb ' Show the Database now!
if( Request( "ASPdbClick_999" ) = "applyfilter" then
end if
if (Request( "ASPdbClick_999" ) = "applyadd" ) then
If Session("SV_RecAffected_999" = 1 Then
Response.Redirect( Session( "ThisFile" ) & "?aspDBBut_999=aspDBgridTop" )
else
Response.write("Record was NOT added..... <br><br>" & Session("ASPdb_999_Username")
Response.write("Use the back button on your browser to correct your input and try to add again"
end if
end if
%>
</TD>
<TD WIDTH=30> </td>
<td style="background-color : lightyellow;" valign=top>
<!--#include file="foot.asp"-->
</td></TR></TABLE>
</body>
</html>
-
Wrong record on form (when new records have been added) (reply)
I tried that and got an error message. Is dbNavBookMark defined in the Enterprise version?
MyDb.dbNavBookMark = "ID"
Error msg:
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'dbNavBookMark'
/OAC/hqassoc/technicalservice/tscalls.asp, line 51
------------
Mark at 5/15/01 11:02:13 AM
Beth,
You should use dbNavBookMark. That forces ASP-db to drill down into the record using a key that YOU define.
Hope that helps.
Mark.
------------
Beth Robinson at 5/15/01 10:46:14 AM
My application has 7-8 users adding records to a database. If they need to edit a record, they click on the record number in the grid. It goes to a form with the record detail where they can click on an Edit button to change the record.
When a user clicks on his record to edit, he sometimes does not get his record but another record. This happens if other users have entered new records in the time between the grid display and the click to get the form field. Is there any way to fix this besides refreshing the screen quickly so no one adds a new record before I try to edit one after displaying the grid?
Why isn't the record id (key) passed instead of the relative record reference?
tscalls.asp?aspDBBut_999=aspDBgoForm::5
(ASPdb Enterprise version
<html>
<HEAD>
<TITLE>Technical Service Calls</TITLE>
</HEAD>
<!--#include file=dbconn.inc-->
<!--REQUIRED for CUSTOM TEXT! -->
<!--#include virtual="/aspdb/AspDB.Inc" -->
<body>
<B>Technical Service Call Log</B>
<TABLE Border=0><TR><TD valign=top align="left">
<%' Create the ASP-db™ object:
Set MyDb = Server.CreateObject("ASP.db"
MyDb.dbDAT = str1 ' Connect
dbUnit = 80
' background, foreground, headerbg, headerfg, vstripe
MyDb.dbColor = "white,black,89B5BC,black,CCDADD"
MyDb.dbMode = "Grid"
MyDb.dbGridTableTag="border=3 style=font-size:12 width=500" ' table attributes
MyDb.dbFormTableTag = "border=3 width=300 style=font-size:12 cellspacing=2 cellpadding=2 "
'Select which Table and Fields to show:
MyDb.dbDBType = "SQL"
MyDb.dbSQL = "Select * from TechServiceCalls Order By Timestamp desc"
MyDb.dbGridInc = 10
MyDb.dbSuppressMsg = False
MyDb.dbFilterParams = "UseRSFilter=False, TableTag=Border=3, Assistant=False, Help=False, TextBeforeTable=<b>Please select search criteria and click the Apply Filter button.<br>You can select more than one field for your search.</b><br>"
MyDb.dbGridIndex=False
MyDb.dbButtonAnchor = False
GMAP = "0,Ref #;Username, Associate; Timestamp, Date/Time;Minutes,Mins"
MyDb.dbNameMap = GMAP
FMAP = "Username, Associate; Timestamp, Date/Time;"
MyDb.dbFormNameMap = FMAP
Mydb.dbMemoTextSize="500"
MyDb.dbImageDir="/ASPdb/images/"
'All navigation items, change these as needed depending on screen displayed
MyDb.dbNavigationItem = "Next,Prev,Add,Edit,Filter,ResetFilter"
MyDb.dbNavigation = "top"
MyDb.dbNavigationIcon="std"
'---------------------------------------------------------------------------
' define add/update parameters
MyDb.dbEditParams = "TableName=TechServiceCalls,BookMarkFlds=ID "
Mydb.dbEditDropFlds = "Product,,,Voyager/Voyager Commercial/Odyssey/Precedent/IntelliPak/Large" &_
"Splits/Chillers/Diversified Products/Other;" &_
"SaleType,,,Post Sale/Pre Sale/Both;" &_
"CallType,,,Trane Service/CSO/DSO/IWD/ICS/Contractor/Parts/End user/International/Latin America/;"
' no edit on add for these fields
MyDb.dbEditAddROFlds = "ID,TimeStamp, Username"
'format for form
MyDb.dbEditFlds = "Caller, CallType, SaleType, Minutes, Comments, " &_
"Username[" & Session("sUsername" & "]," &_
"TimeStamp[" & now() & "]"
MyDb.dbGridDisplayFlds="0,1,2,5,10,12"
MyDb.dbFormDisplayFlds="0,1,2,4,5,6,10,12"
MyDb.dbFilterFlds="0,1,2,4,5,6,10,12"
MyDb.dbFormMagicCell = "Minutes, align=right width=20; " &_
"Comments,,<TEXTAREA Rows=3 COLS=60 style='font-size:12'>#Comments# </TEXTAREA>;" &_
"Timestamp,,Format=[mm/dd/yy hh:mm]"
MyDb.dbMagicCell = "ID,width=8% align=right,,index;Minutes, align=right width=20;Timestamp,width=80,Format=[mm/dd/yy hh:mm];" &_
"Caller,width=20%;" &_
"Username,width=10%"
MyDb.dbButtonsOnOff="EditDropOff" ' remove button to turn off dropdowns
' Specify Column Titles
MyDb.dbFldsNotes = "Minutes,Enter call length in Minutes; Comments,Text will auto wrap"
MyDb.dbEditHeader = False
LBUTTON = UCASE(Request("ASPdbClick_999")
'response.write ("x" & lbutton & " button clicked<br>" )
MyDb.dbUserLocalText = zAddhead & ",<br><b>Add a New Record</b>; "
if ucase(left(request("aspDBBut_999",11)) = "ASPDBGOFORM" then
MyDb.dbNavigationItem = "Edit"
MyDb.dbNavigation = "bottom"
Response.write ("Back to <a href='tscalls.asp?aspDBBut_999=aspDBgridTop 9;>Main Page</a>"
else
if (LBUTTON = "FILTER" then
' MyDb.dbNameMap = "1,Date/Time;Minutes,Mins;"
Response.write ("Back to <a href='tscalls.asp?aspDBBut_999=aspDBgridTop 9;>Main Page</a>"
elseif (LBUTTON = "ADD" or LBUTTON = "APPLYADD" or LBUTTON = "EDIT" then
Response.write ("Back to <a href='tscalls.asp?aspDBBut_999=aspDBgridTop 9;>Main Page</a>"
elseif (LBUTTON = "DELETE" then
Response.write("Delete record <p>"
else
MyDb.dbNavigationItem = "Next,Prev,Add,Filter,ResetFilter"
Response.write("Click the Reference Number for call details<p>"
MyDb.dbNameMap = "0,Ref #;Username, Associate; Timestamp, Date/Time;Minutes,Mins"
end if
end if
MyDb.ASPdb ' Show the Database now!
if( Request( "ASPdbClick_999" ) = "applyfilter" then
end if
if (Request( "ASPdbClick_999" ) = "applyadd" ) then
If Session("SV_RecAffected_999" = 1 Then
Response.Redirect( Session( "ThisFile" ) & "?aspDBBut_999=aspDBgridTop" )
else
Response.write("Record was NOT added..... <br><br>" & Session("ASPdb_999_Username")
Response.write("Use the back button on your browser to correct your input and try to add again"
end if
end if
%>
</TD>
<TD WIDTH=30> </td>
<td style="background-color : lightyellow;" valign=top>
<!--#include file="foot.asp"-->
</td></TR></TABLE>
</body>
</html>
-
Wrong record on form (when new records have been added) (reply)
Beth,
That feature went in on 10-14-2000. I'll let support know. They will be contacting you directly regarding a possible update.
Mark.
------------
Beth Robinson at 5/15/01 12:33:04 PM
I tried that and got an error message. Is dbNavBookMark defined in the Enterprise version?
MyDb.dbNavBookMark = "ID"
Error msg:
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'dbNavBookMark'
/OAC/hqassoc/technicalservice/tscalls.asp, line 51
------------
Mark at 5/15/01 11:02:13 AM
Beth,
You should use dbNavBookMark. That forces ASP-db to drill down into the record using a key that YOU define.
Hope that helps.
Mark.
------------
Beth Robinson at 5/15/01 10:46:14 AM
My application has 7-8 users adding records to a database. If they need to edit a record, they click on the record number in the grid. It goes to a form with the record detail where they can click on an Edit button to change the record.
When a user clicks on his record to edit, he sometimes does not get his record but another record. This happens if other users have entered new records in the time between the grid display and the click to get the form field. Is there any way to fix this besides refreshing the screen quickly so no one adds a new record before I try to edit one after displaying the grid?
Why isn't the record id (key) passed instead of the relative record reference?
tscalls.asp?aspDBBut_999=aspDBgoForm::5
(ASPdb Enterprise version
<html>
<HEAD>
<TITLE>Technical Service Calls</TITLE>
</HEAD>
<!--#include file=dbconn.inc-->
<!--REQUIRED for CUSTOM TEXT! -->
<!--#include virtual="/aspdb/AspDB.Inc" -->
<body>
<B>Technical Service Call Log</B>
<TABLE Border=0><TR><TD valign=top align="left">
<%' Create the ASP-db™ object:
Set MyDb = Server.CreateObject("ASP.db"
MyDb.dbDAT = str1 ' Connect
dbUnit = 80
' background, foreground, headerbg, headerfg, vstripe
MyDb.dbColor = "white,black,89B5BC,black,CCDADD"
MyDb.dbMode = "Grid"
MyDb.dbGridTableTag="border=3 style=font-size:12 width=500" ' table attributes
MyDb.dbFormTableTag = "border=3 width=300 style=font-size:12 cellspacing=2 cellpadding=2 "
'Select which Table and Fields to show:
MyDb.dbDBType = "SQL"
MyDb.dbSQL = "Select * from TechServiceCalls Order By Timestamp desc"
MyDb.dbGridInc = 10
MyDb.dbSuppressMsg = False
MyDb.dbFilterParams = "UseRSFilter=False, TableTag=Border=3, Assistant=False, Help=False, TextBeforeTable=<b>Please select search criteria and click the Apply Filter button.<br>You can select more than one field for your search.</b><br>"
MyDb.dbGridIndex=False
MyDb.dbButtonAnchor = False
GMAP = "0,Ref #;Username, Associate; Timestamp, Date/Time;Minutes,Mins"
MyDb.dbNameMap = GMAP
FMAP = "Username, Associate; Timestamp, Date/Time;"
MyDb.dbFormNameMap = FMAP
Mydb.dbMemoTextSize="500"
MyDb.dbImageDir="/ASPdb/images/"
'All navigation items, change these as needed depending on screen displayed
MyDb.dbNavigationItem = "Next,Prev,Add,Edit,Filter,ResetFilter"
MyDb.dbNavigation = "top"
MyDb.dbNavigationIcon="std"
'---------------------------------------------------------------------------
' define add/update parameters
MyDb.dbEditParams = "TableName=TechServiceCalls,BookMarkFlds=ID "
Mydb.dbEditDropFlds = "Product,,,Voyager/Voyager Commercial/Odyssey/Precedent/IntelliPak/Large" &_
"Splits/Chillers/Diversified Products/Other;" &_
"SaleType,,,Post Sale/Pre Sale/Both;" &_
"CallType,,,Trane Service/CSO/DSO/IWD/ICS/Contractor/Parts/End user/International/Latin America/;"
' no edit on add for these fields
MyDb.dbEditAddROFlds = "ID,TimeStamp, Username"
'format for form
MyDb.dbEditFlds = "Caller, CallType, SaleType, Minutes, Comments, " &_
"Username[" & Session("sUsername" & "]," &_
"TimeStamp[" & now() & "]"
MyDb.dbGridDisplayFlds="0,1,2,5,10,12"
MyDb.dbFormDisplayFlds="0,1,2,4,5,6,10,12"
MyDb.dbFilterFlds="0,1,2,4,5,6,10,12"
MyDb.dbFormMagicCell = "Minutes, align=right width=20; " &_
"Comments,,<TEXTAREA Rows=3 COLS=60 style='font-size:12'>#Comments# </TEXTAREA>;" &_
"Timestamp,,Format=[mm/dd/yy hh:mm]"
MyDb.dbMagicCell = "ID,width=8% align=right,,index;Minutes, align=right width=20;Timestamp,width=80,Format=[mm/dd/yy hh:mm];" &_
"Caller,width=20%;" &_
"Username,width=10%"
MyDb.dbButtonsOnOff="EditDropOff" ' remove button to turn off dropdowns
' Specify Column Titles
MyDb.dbFldsNotes = "Minutes,Enter call length in Minutes; Comments,Text will auto wrap"
MyDb.dbEditHeader = False
LBUTTON = UCASE(Request("ASPdbClick_999")
'response.write ("x" & lbutton & " button clicked<br>" )
MyDb.dbUserLocalText = zAddhead & ",<br><b>Add a New Record</b>; "
if ucase(left(request("aspDBBut_999",11)) = "ASPDBGOFORM" then
MyDb.dbNavigationItem = "Edit"
MyDb.dbNavigation = "bottom"
Response.write ("Back to <a href='tscalls.asp?aspDBBut_999=aspDBgridTop 9;>Main Page</a>"
else
if (LBUTTON = "FILTER" then
' MyDb.dbNameMap = "1,Date/Time;Minutes,Mins;"
Response.write ("Back to <a href='tscalls.asp?aspDBBut_999=aspDBgridTop 9;>Main Page</a>"
elseif (LBUTTON = "ADD" or LBUTTON = "APPLYADD" or LBUTTON = "EDIT" then
Response.write ("Back to <a href='tscalls.asp?aspDBBut_999=aspDBgridTop 9;>Main Page</a>"
elseif (LBUTTON = "DELETE" then
Response.write("Delete record <p>"
else
MyDb.dbNavigationItem = "Next,Prev,Add,Filter,ResetFilter"
Response.write("Click the Reference Number for call details<p>"
MyDb.dbNameMap = "0,Ref #;Username, Associate; Timestamp, Date/Time;Minutes,Mins"
end if
end if
MyDb.ASPdb ' Show the Database now!
if( Request( "ASPdbClick_999" ) = "applyfilter" then
end if
if (Request( "ASPdbClick_999" ) = "applyadd" ) then
If Session("SV_RecAffected_999" = 1 Then
Response.Redirect( Session( "ThisFile" ) & "?aspDBBut_999=aspDBgridTop" )
else
Response.write("Record was NOT added..... <br><br>" & Session("ASPdb_999_Username")
Response.write("Use the back button on your browser to correct your input and try to add again"
end if
end if
%>
</TD>
<TD WIDTH=30> </td>
<td style="background-color : lightyellow;" valign=top>
<!--#include file="foot.asp"-->
</td></TR></TABLE>
</body>
</html>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|