VBScript runtime error '800a01b6' - vbscript

I'm trying to add data to access database, but its prompting a error
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'directory'
/opac/search/form_ac.asp, line 17
asp code of this error is:
' title = ChkString(Request.directory("title"))
description = ChkString(Request.directory("description"))'

As Martha explained in the comments, the ASP Request Object does not have a directory Property. It is used to access Form or Querystring input.
You can find information about it here, f.i..
You say, you had this code working in another environment? Maybe there was a custom class overriding the default Request object. Such an object could have provided a valid "Directory" property.
You could check all included code.

Related

Microsoft Power Automate - error with flow - Action 'Parse_JSON' failed

I have an error with my flow - Action 'Parse_JSON' failed:
Details:
Unable to process template language expressions in action 'Parse_JSON' inputs at line '0' and column '0': 'Required property 'content' expects a value but got null. Path ''.'.
Please see the screenshot above, it appears when a the file upload feature on the MS Form is not inputted, but as this question on the Form is optional we need this flow to work either when the file upload is present or not.
Many thanks,
Andy
Most likely your JSON is expection data in a field that got null. In the example her I fixed it by adding "null" as a valid value, so "emailadress2" is no longer mandatory.
See also https://powerusers.microsoft.com/t5/General-Power-Automate/Handling-NULL-in-Parse-JSON/td-p/40906

Veracode issue CWE 915

I'm having a POST method in my ASP.NET core web API which takes a model as a parameter (binding POST content directly to model). The model contains all the parameters as optional parameters. While scanning the web service using Veracode, I get flaw-1 with CSE 915 (Insufficient input validation for ErrorReporter Service reasons.) which is the possible scenario for MVC EF application.
I have gone through the article. It is saying to use Bind attribute with Include and Exclude properties. But in my case, I don't have any parameter which is mandatory to pass in the model.
Is there any alternative to resolve this or any attribute using which I can remove the Veracode scan for this specific method in the code itself.
Insufficient Input Validation is caused by using the user input directly to take decisions and it can be overcome by sanitizing the taken input.
var userInput = new Sanitize(userInput).Value;
This Sanitize method could be put in appropriate class of your project
public Sanitize(dynamic input)
{
string inputValue = Convert.ToString(input);
Value = inputValue.Replace("<", "").Replace(">", "");
}

Using Cake w/ url extensions

I am using CakePHP 2.0 (I believe it is v2.0.3.) and PHP 5.3.8.
I am working on an application which utilizes Cake's support for url extensions. Specifically, I am outputing XML whenever a url request ends in the .xml extension. If the url request is made without any extension, then my application presents the stardard view. This all works beautifully --
request .../controller/action.xml renders via view/controller/xml/action.ctp while request .../controller/action renders via view/controller/action.ctp.
To achieve this, I did the following:
1. Added support for url extension; added the following line to route.php -- Router::parseExtensions('xml');
2. Added support request handling; added the following line to MyController.php -- public $components = array('Session', 'RequestHandler');
To output xml, I am using Cake's 'XML' class in conjunction with PHP's 'SimpleXMLElement' class. My problem is that the complete xml is never generated. The classes are suppose to generate xml based on an input PHP array, however, it appears that the complete array is not processed. My xml output is partial.
My source code in my view file (.ctp) is as follows:
$simple_xml_elem = Xml::build($xml_array);
echo $simple_xml_elem->asXML();
Interestingly, in the course of trying to debug this problem, I discovered the a similar behaviour can be observed if I simple attempt to dump the view object within the xml view file (../view/controller/xml/action.ctp). 'var_dump($this)' only output a partial dump of the view. The same view dump performed within the standard view file (../view/controller/action.ctp) outputs a full dump of the view.
It is my believe that Cake is somehow setting up the view environment differently when it routes for a url extension than when the standard view is requested.
Could some please shed some light on the for me before I lose my hair. Please???? Thanks!
Have you looked at the response & request objects
http://mark-story.com/posts/view/the-cakerequest-object-in-cakephp-2-0 - the article was written when cake 2 was alpha I think but Mark talks about the concept of request object (another entry for response)
both objects are passed to the controller
http://book.cakephp.org/2.0/en/controllers/request-response.html
for now I believe you use the request comp to handle layout switching (although it can be done without it)

Is there alternative way to access session details in deferred custom action?

I have a custom action and need to get below values for copying some parts from installation folder to VS2010 folder
VS2010 directory path (VS2010DEVENV property)
Installation path (INSTALLLOCATION property)
To give enough privileges, I've set custom action as Execute='deferred' Impersonate='no'. But when running the installer, it logged the message:
Cannot access session details from a non-immediate custom action
It seems we cannot access a property in a "deferred" custom action (i.e session["VS2010DEVENV"])
Is there any other way so that I can retrieve those values as needed?
This must be helpful. Pay special attention to the bottom of the page, a guideline of 2 steps how to pass values via CustomActionData.
Here is the excerpt:
To write the value of a property into the installation script for use
during a deferred execution custom action:
Insert a small custom action into the installation sequence that sets the property of interest to a property having the same name as
the deferred execution custom action. For example, if the primary key
for the deferred execution custom action is "MyAction" set a property
named "MyAction" to the property X which you need to retrieve. You
must set the "MyAction" property in the installation sequence before
the "MyAction" custom action. Although any type of custom action can
set the context data, the simplest method is to use a property
assignment custom action (for example Custom Action Type 51).
At the time when the installation sequence is processed, the installer will write the value of property X into the execution script
as the value of the property CustomActionData.
Additional details: multiple property values can be passed by using the following syntax in a "Custom Action Type 51" (which is basically just a custom action that sets a property value):
PROPERTY1=Value1;PROPERTY2=Value2;PROPERTY3=...
Values can be retrieved from within the custom action like this:
string prop1 = session.CustomActionData["PROPERTY1"];
string prop2 = session.CustomActionData["PROPERTY2"];
Here's an example that sets property values for a custom action with ID "MyCustomAction":
<CustomAction
Id="SetCustomActionPropertyValues"
Property="MyCustomAction"
Value="INSTALLDIR=[INSTALLDIR];EXECUTABLE=[#MyExecutableFile]" />
(read this MSDN article for more details on the formatted syntax which in this example is used to retrieve the install location of a file with ID "MyExecutableFile")

Setting and reading a session

I have a couple of classic ASP pages that require a user to enter their email and a specified 'keycode' that they have been given in order to gain access to a voucher that they can have emailed to them.
A voucher code is then dynamically generated and (currently) sent in the query string of the url to a second page that would then give the user the option to have the voucher emailed.
I now want to change this so that the voucher code is set as a session, rather than passing it via the url. But i'm having trouble trying to set the session.
I have pasted the code here in a Gist on github: http://gist.github.com/187622
The code errors on Line 47 as follows;
Microsoft VBScript runtime error '800a01a8'
Object required: 'Session'
/bennettsget/default.asp, line 47
I was wondering if anyone would be able to help? Apologies if my explanation or terminology is not correct. Classic ASP is not my language of choice, but it is one of those sites you inherit when starting a new job.
Thank you.
Remove the word "Set". Try
Session("fullcode") = fullcode
Set is usually used in conjunction with a full-blown object. When you're working with a Session, you're really setting a value for a collection rather than the creation of an object.

Resources