|Go to a Record|
ASP-db provides two ways to enable the navigation to a record. One is via an input box in the navigation bar and the other is via a URL parameter. in either case the "NavGotoFldIndex" keyword must be set to a field ordinal number. If only the user URL setup is desired then set ShowNavGoto to False to hide the Go button in the navigation bar.
"NavGotoFldIndex=Field Ordinal index, ShowNavGoto=True"
http://MyServer/MyProgram.asp?aspDBgoto_Unit="N(th record) | +Page | %Prefix"
X.dbOptions = "NavGotoFldIndex=0, ShowNavGoto=False"
Note: Going to a record directory via a record sequence number is not an accurate way of positioning the record pointer as if record(s) are inserted/deleted before the destination record, the positioning will be off. User must evaluate the pros and cons of using this approach. However, locating a record via the key and prefix is more accurate.
Set X= Server.CreateObject("ASP.DB")
X.dbUnit = 1
X.dbMode = "Dual-Horiz"
X.dbDSN = "DSN=CARDB"
X.dbGridDisplayFlds = "Car, Manufacturer, Year"
X.dbOptions = "NavGotoFldIndex=0"
X.dbSQL = "SELECT Car,Manufacturer,Year,Transmission,Price,Engine,MPG,Picture,Comment FROM CarSpecs order by 1"
In the above module, the "NavGotoFldIndex" keyword setup the navigation to a record. This navigation act is only valid for a single pass. That means, after navigation to the record, the setup will be erased and subsequent navigation (next, prev etc..) will be in a normal manner.
Look at the navigation bar, a "go" button is displayed with a text box next to it. There are three options for this input box -
The other navigation method is via the URL directly in which user designate which module' display will start at which record. This is especially useful when a record location is generated by module #1 and module #2 need to got the same record. For example -
Note: User must URLencode the "+" and "%" as %2B and %25. Do not input something like http://MyServer/MyProgram.asp?aspDBgoto_99=+3 as +3 will be interpreted as "space 3"