I am trying to make our website a bit more dynamic. one of the ways i want to do this is to be able to put in ASP code into our MySQL database (the code would be different for every company) and have it execute when the page is brought up.
We have the potential of having thousands of companies using our website, so having it hard coded will be hard to maintain, and having it save to a file will become cumbersome if there are too many users. Anyone have any ideas on how to execute a piece of ASP code straight from a string varaible?
with dos command of " ipconfig/all>c:ip.txt " I can retrieve some info and save it in a text file of ip.txt, now I am wondering if there is a way to do the same thing within asp?
I have a shell script that needs to be executed on a unix machine on our network and text output needs to be retrieved How can I make a asp.net page do it ?
is there a way to batch execute the command that I execute in the command prompt and just retrieve the outoput.
Here is what I am manually executing currently from the dos command prompt
Step 1. telnet <unixmachine>
Step 2. login <login name>
Step3. I Provide the password
Step4. once logged in to the machine I Provide the <shell script command>
The results of the script get displayed on my command window. I copy and paste the result
I need to be able to execute DOS command lines via ASP. This would include running an .exe along with passing commands/switches.The platform is Win2k/IIS.Is this easily accomplished with ASP?
I would like to know how could I execute a command/script on server side which is located in the same directory as the asp ? And how could I response.write() the result?
DBMS: MS Access 2000 ADO Version: 2.8 IIS Version: 5.1
I'm trying to use the ADO's Command object, Execute method to execute a SQL Update Statement. I would like to ask how do I check for the no of rows affected by the SQL Update command.
but this seems to disable the onLoad command, presumably because there is already a full header and body in the "index.asp" file
the reason why i didn't use the "include file" command here was because the latter won't allow the title string to be fed through
the question is : is there an alternative way to execute either the "Server.Execute" or the "body onLoad" command that will allow the function showHide() to work ?
the same function is also called from a "select" form element Code:
<select onChange="showHide()">
and that works fine, so the problem definitely lies with the onLoad command, not the showHide() function.
Suppose there is a page at http://mysite.com/schedule.asp
Is there a way for me to write an ASP program which loads http://mysite.com/schedule.asp into a string? That is, instead of outputting directly to a browser, it outputs to a string?
I have an online application. I get the following error when a user selects an option from one drop down list but doesn't select an option from another drop down list. Here is the error:
Microsoft OLE DB Provider for SQL Server error '80040e0c' Command Text was not set for the command object. Code:
I have an online application. I get the following error when a user selects an option from one drop down list but doesn't select an option from another drop down list. Here is the error:
Microsoft OLE DB Provider for SQL Server error '80040e0c' Command Text was not set for the command object.
I keep getting this error. I searched the forums, and found one. It said to basically replace elseif with else. It worked for that person.
I tried it and it didn't work. So what i decided to do was, remove all of the if statements and keep one. Even with just one if statement i get the same problem. Does anybody know what is wrong? It worked fine, up until i added the if statement. I need them there though for a reason.
Personally i think, it;s not getting the value from the request form, and hense it isn't picking anything up. What do you lot reckon? Code:
I'm developing an Asp.NET system to take a CSV file uploaded via the web, parse it, and insert the values into an SQL database. My sticking point comes when I try to split() the string returned by readline() on the file.
The following code snippet works for me: tokens = "one,two,three,four".Split(",") for each token in tokens response.write("<td>"+token+"</td>") next
However, if I take the next line in the CSV, read using StreamReader.ReadLine on the PostedFile.InputStream, I receive "Object reference not set to an instance of an object." which I have narrowed down to be my string holding the line. Further investigation reveals that no other string member functions work on my line (.ToCharArray, .ToString, etc).
I suspect that StreamReader.ReadLine is not correctly returning a string, even though Response.Write(line) displays what I would expect .....
I have a form that uses the POST method to call up test.asp and it passes what is typed into the text box. Since is uses the Like command the user can enter stuff like %Constant% to get something that is like what the user typed in. When I call up the test.asp page it is grabbing the text fine but isn't running the SQL command the correct way. The SQL command ends up being:
SELECT * FROM [Everyone] WHERE (Name LIKE ':: & strName & ::')
Here is my code
strName = Request.Form("Search") Set Conn = Server.CreateObject("ADODB.Connection") Set Rs = Server.CreateObject("ADODB.RecordSet") Conn.Open "PhoneList" sSQL = "SELECT * FROM [Everyone] WHERE (Name LIKE ':: & strName & ::')" Set Rs = Conn.Execute(sSQL)
I am using DW to create this ASP page and I need to do a simple calculation that will result in a cell being 10% of the previous cell. I am using this statement:
I would like to use the sql command to query the database from ASP. But it keep showing me the error. Select location from the table tapeinfo. The location must start with "Data". Here is the command?
'sqlStrl="SELECT * FROM tapeinfo WHERE location like ' "&Data&"% ' "
Anyone can help me to verify whether it is correct?
I have a form that uses the POST method to call up test.asp and it passes what is typed into the text box. Since is uses the Like command the user can enter stuff like %Constant% to get something that is like what the user typed in. When I call up the test.asp page it is grabbing the text fine but isn't running the SQL command the correct way. The SQL command ends up being
SELECT * FROM [Everyone] WHERE (Name LIKE ':: & strName & ::')
Here is my code
strName = Request.Form("Search") Set Conn = Server.CreateObject("ADODB.Connection") Set Rs = Server.CreateObject("ADODB.RecordSet") Conn.Open "PhoneList" sSQL = "SELECT * FROM [Everyone] WHERE (Name LIKE ':: & strName & ::')" Set Rs = Conn.Execute(sSQL)
Some of these could be null but what i need to do is caputre the highest number and place that in a database. I assume i can use the max command but a bit unsure how to do it.
I am having trouble trying to figure out how to properly enter a checkbox in the SET statement so I can update the checkbox value based on user's input. I know for number values you enter the variable like this: Code:
Owner = own
and for text you enter like this: Code:
Priority = 'pri'
and for dates you enter the variable like this: Code:
tdate = #td#
but how do you create the variable in the SQL statement so it updates a checkbox value? Below is my SQL statement, and the checkbox name is "Active" Code:
I found this asp code in this forum but can not get it to work with my command
<% Dim oShell, sCommand sCommand = "MyCommand" Set oShell = CreateObject("WScript.Shell") oShell.Run sCommand, , True Set oShell = Nothing %>
I replace "MYCommand" with the command i wish to execute but the page just hangs with the blue status bar halfway complete at the bottom, when checking the services on the box it is not restarted.
i build my sql string by using bunch of if-end if statements, after storing the whole SQL string into variable strSQL i put into the command object's CommandText property like so:
objCommand.CommandText = strSQL Set rsRec = objCommand.Execute 'rsRec being a recordset
then i want to be able to display the data: While Not rsRec.EOF Response.Write(rsRec("FIRST_NAME") & " " & rsRec("LAST_NAME") & " - " & rsRec("FIRM_NAME") & _ " " & rsRec("EMAIL") & " " & rsRec("CITY") & "<BR>") rsRec.MoveNext Wend
but this gives me an error saying: Object doesn't support this property or method: 'CommandText'
I am trying to adapt an SSI content management system from an Apache server to an IIS 6 server and I am running into trouble because 'set' is not supported in IIS SSI. Code:
I'm currently working on an ASP site that connects to a MySQL database I've built a form that allows users to insert press releases. They add the date and title and then the text of the release. The problem that I'm having is that every so often when the user submits the form they get an error message saying "Command text too long" The record isn't added to the database after this .I use a longtext field for holding the main text of the press release