Unable to perform Response.write - asp-classic

I have a classic asp page for which I would like to perform the parametrized style asp debugging. The debugging is for finding the SQL used. I am trying to debug in Visual Web developer 2010 but the debug options are grayed out. When I put in Response.Write I am getting the asp page as usual. Kindly assist.
The code snippet is below:
'//Create Recordset
Set SKUOutput=Server.CreateObject("ADODB.Recordset")
'//Open Recordset
SKUOutput.Open SKUQuery, SKUConnection, adOpenDynamic, adLockOptimistic
recordCount=SKUOutput.RecordCount
SKUOutput.Close
Set SKUOutput=Nothing
'//Create Recordset
Set SKUOutput=Server.CreateObject("ADODB.Recordset")
SKUOutput.Open SKUQuery, SKUConnection, adOpenDynamic, adLockOptimistic
response.Write SKUQuery
response.End

I'd put your response.write statement before skuoutput.open
I think the greyed out options are for .net only - the way to debug classic asp is to run it on your server (or development server) and read the error message in the output.

Related

aspCode runner generates which syntax of CODE?

i'm using ASP RUNNER software to generate auto code, it generates this code
Function employeeRecord_Snippet1()
Response.Write "Your message"
End Function ' employeeRecord_Snippet1
now i don't understand that is it ASP.net code or ASP code ?
From the product homepage
"ASPRunnerPro creates professionally looking classic ASP applications enabling users to search, edit, delete and add data to the Oracle, SQL Server, MS Access, DB2, or MySQL databases."
http://xlinesoft.com/asprunnerpro/

using asp.net dll in classic asp

I've followed this: http://www.codeproject.com/Articles/19535/NET-COM-Interop-Component-with-Classic-ASP-Part-I & http://bruceburge.com/2009/06/11/sharing-net-libary-dlls-between-asp-classic-and-aspnet/ to use asp.net dll in classic asp.
Step 7 listed in first URL didn't work me hence I followed steps given in second URL to to create installation. It works & can see URL in GAC. Unfortunately, it is not working in classic asp.
I tried "regsvcs" at command prompt but didn't work. have developed using C#
Anybody knows what I'm missing?
Update: I could see component under Component Services. I don't see method name under Interfaces & creating object of component is not working. am getting this error:
Expected end of statement on line:
set obj= server.CreateObject("my_dll_New.Class1");

Can I run vb script from C# application ?

Can I run vb script from C# application.Can anybody provide me vb script with exam
like on button click show message,if perticular panel is visible.
i don't think you can run vb script code inside c# code, but this How to call a VBScript file in a C# application?
could do the job
You can't execute VBScript directly in the same C# process, but you can execute it through a separate process using the Process class.
Process.Start("path to vbscript", "arguments if any");
If you are talking about client side on a browser, then this can only work on IE (the only browser that supports vbscript).

Gettin error bjSysInfo = CreateObject("ADSystemInfo") in classical ASP in IIS7.0

I'm getting undefined object CreateObject("ADSystemInfo") when I embed the code in classical asp that is hosted in IIS7.0 on Windows Server 2008. When I excute the same code on that server using VBscript it is working fine. Could some one help me. I need to know if I need to make any server settings changes
Set objSysInfo = CreateObject("ADSystemInfo")
strUserDN = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUserDN)
arrGroups = objUser.memberOf
This is because what you wrote about is actually VBScript, and not Classic ASP.
You can run this from the cmd window and it should work fine. But to convert it to ASP, you have to do a couple things.
Surround your code with
<%
... code here
%>
And then change every instance of CreateObject to Server.CreateObject
Your code would look like this:
<%
Set objSysInfo = Server.CreateObject("ADSystemInfo")
strUserDN = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUserDN)
arrGroups = objUser.memberOf
%>
Finally, make sure that the IIS webserver is running as a user that has the correct permissions.

Inline server tags in Mono ASP.NET

I have recently managed to make my ASP.NET MVC application run under Linux with the Mono runtime. The .aspx pages execute perfectly, including assignment inline server tags, eg:
<%= "Some output" %>.
Unfortunately, it seems that those tags for simple code execution are not treated by the server. Here is an example:
write if true
Regular ASP.NET will display "write if true" only if someBool is true. Mono will output the whole statement including the server tags.
I cannot find any documentation about that problem... can you help me?
Hmm, your example works correctly for me on Mono 2.4.2.3.
What version of Mono are you using?
Did you precompile your website on Windows?
Is it inside a more complex code execution block?

Resources