I am running a dynamic site using MySQL and ASP and wish to back up my MySQL DB on a daily or weekly basis to a remote server/MySQL DB. I know how to do this from the command line using MySQL:
But i need to be able to issue this command from within an ASP page. PHP has various methods for executing command line queries such as exec() & shell_exec() but I don't know any using ASP.
Im trying to use teh command line, for now i just want to do something realllly basic like opening a txt file. and then later i can do some more advanced stuff, but for now i just want to know if i can use the command line, right now i just have Code:
<% Dim oShell,sCommand sCommand = "test.txt C:" Set oShell = Server.CreateObject("Wscript.Shell") oShell.Run sCommand, , True Set oShell = Nothing %>
I'd like to send a variable generated in the script back to a batch file. I can run the batch file by using objShell.Run(lock.bat filename). My batch file lock.bat runs fine with the argument "filename", the problem is that "filename" is actually a variable that is created in the script and I want the value passed to the batch file, not the label. Any ideas/sampe code
The the user will access a web page and it will be asked for the username , password and it will be able to select the options by marking them on the page.
After the selection the command line will be executed with the selected oprions.
If somebody can point me to some example code or any hints to get me started I would appreciated it.
It is possible to specify also the credentials the "program.exe" should run under?
I am using command line utility of wzzip.exe in asp and vb script. When I try to use wzzip in asp, it sometimes works fine and sometime hangs. It doesn't give any error.
The server that the process is running on, if I logoff from that server, wzzip.exe hangs, however when I just "disconnect" from the server, it runs fine. This happens when I try to use wzzip.exe from my user interface. The code to invoke the shell is in a dll which resides in MTS. I am using the following wzzip command in asp.
cmd.exe/c "c:Program fileswinzipwzzip.exe -a servernamefolderfilename.zip servernamefolderfolder_to_be_zipped
When I run it manually command line, there are no problems.
I have a similar job which I have in vbscript, that job runs without any issues.
I had created a macro to read data from an excel sheet and write the values to a text file. I had used "ActiveSheet.Range("GB" & k).Value" command to read the values from the excel.some cells in the excel sheet is having two lines value and four lines data, the text file is generating that value in a single line. (Ex. the cell value in address column is in four lines and should display in four lines in the text file generated from the macro)
Can i do something in the excel sheet or in vb script to read the address value line by line and write line by line in text file?
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 have an encrypted .txt file created by asp. Its formatted with lines etc. Title followed by description underneath. I need to read this into ASP now, and parse it line by line. On each line read, run the function to unencrpt and add line to a new file.
Its the line by line Im having trouble with. If i do the full textstream no formatting takes place coz im adding the fulltextstream all in one addline call. How can I loop through lines ?
Normally I use Access database with ASP, and I create queries using the wizard which Access has. Then, I copy and paste the code in the ASP page and create my SQL.
I was wondering if it is easier to call the query directly with its name from Access, or else continue using the old procedure.
I'm trying to build sql queries that will search through my DB. I am currently seperating my queries through multiple indexes in an array depending on whether or not the strings are wrapped in quotations.
I also want Fluffy Teddy Bear (three different LIKE statements)
Say I have 5 fields in a form. I have figured out how to query a database using all 5 fields and display the records that match at least one of the fields.
I'm trying to figure out a way to, if say the user only fills in two fields, to only search the database for matching records based on just the two fields. As I have it now, the database is searched for the two fields they entered as well as three fields of "", which I would rather not have. Is this possible?
I have a DB. With 1 table called "products" and 3 product records. The 2 fields present in the table are called product_name and product_price. The names of the products are Product1, Product2 and Product3. They cost 13, 8 and 24. Which code (SQL and AP) would generate an output similar to this?
<% SQL = "Select * FROM products" (plus some kind of sum function to calculate the total (to be able to display the sum before the various products) of the recordset without having to loop through the recordset first) %>
I need to connect to 2 different databases in ASP and execute two different queries. Please let me know how to proceed. I understand that ADODB.Command option can connect to only one database at a time.
I never ever thought about this, but recently I made a query in access so I can make a customer mailing list based on relational information and it was so easy to make the query and join tables and assign criterea using access. And I haven't tried or thought about this cause in my own small asp projects I've never used a dbase with queries in it, but after seeing how easy it was, it would save a lot of time from manually writting queries in asp.
So, what I'm asking is if I can use a query from an mdb in asp just like I can access tables?
Can I have one recordset execute a Select and then have another recordset execute a different Select, and then check if a field from the first recordset is different from the field in the 2nd recordset and if so write out that row on my displaying table?
I am using ASP and crystal reports 8.5. I am able to show report from asp. My problem is , I have to show the report based on the sql query that is passed to crystal report from asp. I actually dont know how to pass a query into crystal reports from asp.
I have a single asp page (index.asp) with an include file (include.asp). I would like to query the database with index.asp as well as query it with include.asp.
I searched online, in my "SAMS Teach yourself active server pages 3.0 in 21 days" and it makes no mention of two queries on a single page. Is this even possible?
Is it possible to use an If statement to select a single query from a list of queries from an access db? Something like this:
If Request.Form("Womens") = "Pants" Then 'open the db and run the query called pants ElseIf Request.Form("Womens") = "Shirts" Then 'open the db and run the query called shirts 'on and on we go, etc. End if
My gender categories (women, men, etc.) have multiple sub categories (shirts, shoes, skirts, etc.). Does is make sense to use an if statement(assuming it can be done) in this manner? It seems it would make life easier to use one script to perform many tasks, as opposed to one script that does just one task.
the following statement doesn't work, even thoug when I execute SQL_1 and SQL_2 separetlly it works fine.
SQL_1 = "SELECT COUNT(*) AS ACTIVE_LINKS FROM TABLE_LINK WHERE ACTIVE = 1" SQL_2 = "SELECT COUNT(*) AS UN_LINKS FROM TABLE_LINK WHERE ACTIVE = 0" SQL = SQL_1 & " UNION " & SQL_2 ...
I know that asp can be used to fire off stored procedures within databases, but I was wondering - does a 'query' in Access mean the same thing as stored procedure? If it does, how could I get asp to fire off that procedure when needed?
I need to take two seperate queries and put them in a single html table, but i want to combine the sets of data 'while selecting them' so i can use the SQL sort by command to arrange the whole table by date..
sorting the two queries independantly then dumping them to the table results in both queries being sorted independantly, ie the most recent entry(by date) of the second set of data ends up in th emiddle of the table.. any ideas?