I have just got back into ASP development after a years break and am playing catchup. I am developing a simple page with combo boxes on it, so that when it is processed it searches a database for all records between the chosen entries in the combo boxes. However I am also trying to stop the page from returning errors when a user clicks submit without choosing any entries from the combo boxes. I am trying to get the page to just re-display itself with a simple error message on the page informing the user that they have to choose an option from both combo boxes.
I am using DW8 to create a simple database-driven site using IIS and ASP vbscript. I have created a virtual directory in IIS and I have created the DSN, connection and appropriate recordsets. The problem is I keep getting the following error:
The line the error refers to is always the connection string. And it seems to be intermittent. Sometimes the page works fine, other times I get this error - but I can't figure out why. I always make sure that I save my files and put them to the server so I really can't work this out.
I am working on a date function, which takes a YYYY-MM-DD input and splits it into dd,mm,yyyy format. e.g:
string1 = "2006-10-20"
Function stripDate(str) str_len = len(str) if str_len = 10 then str = replace(str, "-","") str_yr = left(str,4) str2 = right(str,4) str_mo = left(str2,2) str_dy = right(str2,2) stripDate = str_dy & "," & str_mo & "," & str_yr else Exit Function end if End Function
test = stripDate(string1) sample output: 20,10,2006
I then want to pass the sample output into another function, but in order to do that, the date variables must be split with speech marks as follows:
"20","10","2006"
but I can't work out how to include that in the stripDate function so that it wraps the variables in speech marks. Whenever I try to include the speech marks the code returns the usual error about unterminated string constants e.g. if I replace the final line of the above function with this:
How do I format a specific string and add dashes inside the string. The output I get from the recordset, for example, is 007275153. I want to format the output as 00-727-5153.
Also, if a string in a database is C-1411C1, how can I remove the "C-" at the beginning of the string?
How do i check the whether a string entered...matches a fixed format that i have created? suppose i have to checkk whether a string entered is of this format.. F-## ( where '#' is any digit)..
For example if the user enters F-02 ..Then the check would return TRUE.. If the user enters F02 ...Then the check would return false.. I would like to do this check on the server side...ASP ( not javascript)]
I have a 20 character string that I need to format in a certain way. For instance, here is the raw string:
12345678901234567890
And I need it to look like this:
123-45-6789-01-234-5-67-8-90
It wouldn't bother me if the number was entered into a text box without any dashes, but then before I submit the number to the db I would need to enter the dashes in the correct spots. Can anyone give me an idea of how I can accomplish this?
I have a client with a database whose author didn't do any type of form verification. Hence, in the "price" field, there are values such as 213000, $32,400, 5000 USD, etc.
What I am hoping is that some might tell me how to take a string, cut out all white space first, then go character by character to test for INT. Once done, count the characters, insert a "," where appropriate, and display on a page? Can this be done?
I am using ("Microsoft.XMLHTTP") to grab content from a site and display it on my site, the issue I have and have had for weeks now is that on the original page the sign "£" exists and when I get it to my site it is displayed as a "?".
If I find the ASC code for the ? and replace on that it still does not work :-(((
I have tryed all the usual method of fixing this with no success...
anybody had this issue or know where I might start to look to fix it ???
I've created a form where people can request samples of our product to be sent to them. I've created a list page where it lists out all of the current requests that still need shipped. In my database I have a field called shipped with data type yes/no.
I made another page which lists all requests that need shipped based off that shipped field (yes/no.) From this list there's a link to view the details of each record. On that details page I'd like to include a check box that we can simply click to mark the shipped field to yes so that it won't show up on the list of stuff that needs shipped anymore.
I am trying to retrieve arabic fields from sql server 2000 database , the collation for the database is arabic and the content of the column are in arabic but am getting question marks displayed in my ASP web pages when am tring to retrieve the contents of this columns
I am having trouble getting the 's and +s on this statement correct. The first select line works as it is supposed to but the 2nd one does not. Can anyone correct this and perhaps tell me/point me in the direction of the rule of thumb for stuff like this?
I am using cdo.message for sending mails I get the data I Hebrew and I send it to the mail the problem is that I get the mail with: question mark "?????????"
Subject HTMLBody Sender Organization
all in question mark
what can i do to see it all in the language Hebrew?
I created a form that puts a text in a sql db just like it is typed in the text field. So when I type: Het potentiëel is dat er .... puts this exact in the database.
An other page takes the value from the db to create a VML/XML based page. but this goes wrong on the words with punctuation marks like ë.
If I look at the source it shows exact what is placed in de db: Code:
One thing I've started to notice lately is that asp seems to be very sensitive to how quotation marks are layered. Does anyone know where I can find out when to use double quotes and when to use single quotes? Code:
SelectSQLB = "SELECT * FROM TeamRosters WHERE IDNumber = Session(' 'TeamMember' & LoopCounter')"
Is the line that's giving me trouble and I'm not really sure how to layer it. Every logical combination I've tried has produced a different sort of error. Note that TeamMember# is a session variable and loopcounter is a local variable used to select which TeamMember# session variable to use. Before I've noticed that pretty much it works like this: " ' ' " but that was for two layers deep. What's the syntax for going three layers in?
I am looking for a way that I can trap the single quotation mark. If an encoder uses single quotation mark on a textbox field, it always give me an error because I use single quotes on the SQL statement.
<LI>Error Type: Microsoft JET Database Engine (0x80040E10) No value given for one or more required parameters. /test/searchlibrary.asp, line 273 line 273 : objRS.Open strSQL, objConn, , , adCmdText
I have the tables set up in Access, viewing in column format on ASP pages but now the company wants the schedule reports to be in a wall-calendar type format. I've searched and found calendar scripts but I need one that's creates a table resizable to a report size format. Using the existing MS Access db I've written is also a plus.
How can i detect if a database already has a primary key value that i want to insert. ie. i want to insert 5 into a database that already has a primary key set to 5.
We have many forms on our site that users can fill out and ask questions, request information etc. but somehow, we receive a lot of junk mails (more than two hundreds) within two weeks through these forms. I don't know hot to stop these junk emails.
I want to make a simple simple asp page. All I want is when the page loads it does "net stop <service>". The code is below, it is not running as IUSR_<machine>, I am authenticating as Administrator yet the service does not stop.
The blank page just loads with no errors and the service remains running, what am I missing? I am completely new to ASP, I just want one simple page for this purpose. Code:
I dont want to start the sessions when my asp page is run....how do I do that...can I add something at the start of the page which will not enable the session