I am pulling info from a sql server By default the query pulls back the inforamtion as text.Therefore when I go to calculate some figures its giving me a type mismatch error.
Is there a function in can call to convert a text string to an integer string using
rstSearch.Fields("name").Value .To pull back the info in a for loop
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch
I have a shop with products and on the product display page there is the price! This price can have discounts, extra charges etc and the calculations are done beofre the price is shown. The price is shown as $main_price which is in the format $1.23 How do I: Strip the $ off then convert the rest to interger so I can then do a calc like the following: PHP 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 the following code which I try to load an xml file, but in browser, I only get text value for each node, not whole xml string. I expect to see something like:
<name firstName="betty" lastName="Smith">I am at home</name> But I only see text "I am at home" did I do something wrong? Set xmlDom=CreateObject("Microsoft.XMLDOM")
I try to update a text field into Access database. When I click Update button script updates only first word of the phrase excluding other words. How can I fix it. Code:
<title>Partly Cloudy and 73 degrees F at Pitt-Greenville Airport, NC</title>
In an ASP file, how would I get the three characters before the word "degrees"? In this particular case, it would be "73 ". Obviously, I'm trying to extract the degrees from this weather string (which is from the National Weather Service, in case anyone is wondering). If anybody knows a better way to get the degrees information from this string.
EDIT: Nevermind. I found that the National Weather Service also offers an XML version that has the degrees totally separated. (The one above is from an RSS feed rather than straight XML.) Having it in this form makes it much easier to parse.
i have a date format d/m/yyyy h:m:s which users pick from a date picker into a text field in a form. But i want to format the contents into this form - d/m/yyyy.
Pls is there a function i can use to achieve this . I tried format(date_field) but it didn't work.
I have a dynamically generated and FTP'd page that is sent to the server with a title of a song. Then when the user opens the page/site he or she will see the text in a marquee. What I want to do is create a IF Then Statement where it would look like the following:
I am getting a result like this: 'toh23'
and I want it to do either not show it or display and alternative text so...
<% if (TEXTSTRING) = "toh" then response.write("News") else response.write("Normal Text") end if %>
I have the if then else down but I have no clue how to split the text between the 'toh' and the '23'. It will always be toh and then a number but the number changes. I know you can split strings with commas and such but how about numbers?
I have some problem in my ASP project. I'm trying to pass the multi line text value from my Client side to server side. (The string having "Return Key" value). My ASP file doesn't response it.
I have built dynamic HTMLTable. Now I want to attach it directly to the Email Body - it is already built, so why not to use a ready table. However, I cannot find the way of getting plain HTML text out of dynamically built control. I tried to put my table between div and read div.innerHTML then - HTTP exception has been thrown.
I am having a newbie problem trying to Response.Write a static text string, 'Read More' into the output part of a hyperlink. I have tried my way of doing it but it doesn't work.
My code is below (the text string which I want to Response.Write is highlighted in bold):-
Response.Write ("<a href=""dummies_news.asp?ID=" & rsCTD("ID") & """> Read More & ">") Thanks for the help in advance - should be quite simple to solve, I'm sure!
I'm not a asp expert and only use the built in Dreamweaver stuff, the problem I'm getting is a datatype mismatch due to the fact the sql statement is expecting a text string and not a number string, can anyone have a look at the following code and point me in the right direction in regards of what I need to change so the sql statemnet know to expect a number string: Code:
I have a form in which several elements are expected to be all digits. Some of those elements can be left empty, but if specified they must be all digits. I have this Sub to edit them: ....
I am trying to build a table that forms from cats being pulled from a DB. The table will be 3 cols by x rows. I have been doing an if else based on if int(Ident/3)= 1, 2, 3, 4 etc etc , but this is sloppy! Code:
If a visitor doesn't put anything in the "Search" text box I'd like them to be redirected to where they came from before the search form forwarded them to the search.asp page. Therefore I've put the following at the top of search.asp to do this.
I am trying to search my access database for a string using LIKE and a wildcard. Example:
Code:
Dim con
con = "SELECT names.* WHERE name LIKE 'sam*'"
For some reason this gives me no results even though I verified there is entries with the word sam in them.
Also tried using % instead of *. Also took out wildcard. I can search for an integer without a problem though, when I try a string, regardless if there's relevant entries I get nothing back at all.
I am using an SQL statment with a LIKE clause. I am trying to print the actual SQL statement on the screen. However I cannot print a '%' character on the screen. I tried using Chr code and just % outright.
Random variables: name, rank
Code:
sSQL = "SELECT * from myTable WHERE myField LIKE '" & name & "%'"
i need requirement for the current assignment Im working on.Part of my assignment I have to saved updated data from a datagrid and put into database. I had everything working, but without option strict and explicit. When I put it on i'm having trouble getting the value out of it.
What I need is to get the value out of the textbox control of a datagrid in edit mode. The value is supposed to be in Item.cells(2).Controls(0) but I have no clue on how to get it out correctly. Ive tried everything but keep getting errors that it cannot be converted to a string.
the subject that i need to filter the URL from a memo field that having lots of URL in it, like when we post a message with URL www.websourceinfo.com it will become a base url link with click
I searched google for this (probably easy to solve) problem, but all answerd there did not work hop someone can help me out.In an asp I want to check whether a string contains a " if so the response should be that the "-sign is not allowed.
Elseif InStr(1, username, """) > 0 then Response.Write "-sign is not allowed in the username."
Tried char(34) and /" and """ but none of these options seem to work.
This seems like it should be so simple. I would like to create a conditional statement based on the length of a string. The string is a memo field from an Access database. I would like to handle long memos differently from short ones. I'm starting out just by trying to write out the length of the string:
memo = RS("Idea_Note") Response.Write Len(memo)
I can response.write the memo without trouble, but I get nothing for the length of the memo.
I have a drop down list of ssn and text box to input ssn to view the info in the next page. I am having a problem with displaying and when I debugged the code, I am getting a comma next to the ssn. Here is my code the dropdown and input type:ssn is text field. Code: