Unterminated String Constant?
I write following code for call java script funtion through hyperlink column of datagrid
strId=DataGrid1.Items[j].Cells[4].Text.Trim();
DataGrid1.Items[j].Cells[15].Text ="<a href='#' onClick=javascript:fun(escape('" + HttpUtility.HtmlEncode(strId) + "'))>Select</a>" ;
its working fine but if any record have space like "G 59" it gives error
unterminated string constant.
View Replies
ADVERTISEMENT
I've searched these forums but no joy - am sure this is a newbie error but I'm still tearing my hair out. Receiving this message :
Microsoft VBScript compilation error '800a0409'
Unterminated string constant
The ASP code is :
View Replies
View Related
how do i put something like this
response.write "hello world!"
into a string
for eg strtext =" response.write ""hello world!"" "
now i have tried single quotes and double and both give the error
Unterminated string constant
reason i want this is so that i can write this line to a text file
or better yet "<%response.write "hello world!"%>"
into a file and then save it as an asp page, and then open that page from my browser.
View Replies
View Related
i have no idea what this error is referring to. I thought it was a missing quotation set but I'm not sure where it should go
strsql="UPDATE software_signout SET signin_date='<%=date()%>',received_by='" & request("received_by") & "' where id=" & request("id") & "" ...
View Replies
View Related
I'm trying the following:
Code:
response.redirect("shoppingCart_02.asp?carrierName="& carrierName &"&carrierRate="& carrierRate &")
And I'm getting:
Error Type:
Microsoft VBScript compilation (0x800A0409)
Unterminated string constant
/kennyshardwood/freightQuote2.asp, line 476, column 99
response.redirect("shoppingCart_02.asp?carrierName="& carrierName &"&carrierRate="& carrierRate &")
View Replies
View Related
I am trying to resize images which have been retrieved from my database using 2 DLL files. I can display the images correctly but get an error message (Unterminated string constant) when I try to resize them.
The syntax I was given is: ....
View Replies
View Related
I am getting the error message
Microsoft VBScript compilation (0x800A0409)
Unterminated string constant
Here is my Query, It is slight incorrect: HELP.
newest_sql = "SELECT TOP 5 CatID, ContentID, DateAdded, Title, FeaturedLabel, NewestLabel FROM Content, ContentTypes Where Content.ContentTypeID = ContentTypes.ContentTypeID
AND (((Content.Display)=1) AND ((ContentTypes.ContentTypeId)=4))
ORDER BY DateAdded DESC"
View Replies
View Related
I try to make this:
const server="hello"
const conn= server & ".xxx.com"
but it indicate got literal problem. any expert can help me on this?
View Replies
View Related
I have an ASP page in which I reference quite a few ADO constants such as adOpenStatic, adLockReadOnly and they work fine but a reference to adUseServer comes up as undefined?
I have a typelib definition in that page:
<!--METADATA TYPE="typelib" uuid="00000205-0000-0010-8000-00AA006D2EA4" -->
For the time being I used the constant 2 to replace that reference - I hope
that is correct?
Any ideas on why that constant remains undefined?
View Replies
View Related
I have a table (MSSQL 2000 server) with a column called "Content" whose datatype is text. Now I'm trying to insert data into the table using a stored procedure. What is the ADO constant that I should use to insert value into that column? Code:
View Replies
View Related
I need to create an ASP page that automatically queries my database once every hour on the hour. So, what I was hoping to do was just create an ASP page that constantly loops and never actually turns itself off. Within this code, it could check the current time and if it's the top of the hour again, my database gets queried however I have a feeling that my web host probably won't permit this.
So I was just wondering if this would work or if not, is there a work around? Worse case senario is I could create a visual basic application that sits on my desktop and just works off of there but I would prefer to develop this in a web based language such as ASP or .NET if possible.
View Replies
View Related
Why am i getting the above error
<%
'DataBase
const DSN_NAME = "ORADBA"
const DSN_SERV = "localhost"
const DSN_UID = "ORADBA"
const DSN_PWD = "ORADBA"
const MM_Prod_DSN = "dsn=" & DSN_NAME & ";server=" & DSN_SERV & ";uid="
& DSN_UID & ";pwd=" & DSN_PWD & ";"
%>
Please note, MM_Prod_DSN is defined on a single line.
View Replies
View Related
I have a quick question regarding a text field for inserting record, I have a page which inserts various fields including area code an phone number for a new record, however I am curious if there is a way that I can either make the area code appear with brackets around it in the text field which is sent so that the user does not have to type it in each time.
I was thinking I could concantenate the value i send in each time with brackets but am not sure what the syntax would b for this. or perhaps there is another way of doing this?
View Replies
View Related
I am getting this error:
Microsoft VBScript compilation error '800a0415'
Expected literal constant
/....includes oolboxgallery-entry-header.txt, line 29
Const VirtualFolder = "../images/gallery/shop" & session("shop")
----------------------------------------------------------------^
THe issue seems to be with the appending of session("shop") to the VirtualFolder constant variable.
View Replies
View Related
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 .....
View Replies
View Related
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: ....
View Replies
View Related
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
View Replies
View Related
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.
View Replies
View Related
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.
View Replies
View Related
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 & "%'"
It just prints on the screen: (assume name=joe)
"SELECT * FROM myTable WHERE myField LIKE 'joe'"
View Replies
View Related
i have an object which is a string, (objrs4("points")) how do i convert it into int numbers.
View Replies
View Related
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.
View Replies
View Related
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
View Replies
View Related
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.
View Replies
View Related
I guess this is easy, but I ask anyway.How can I cut 'www.' and '.no' or '.com' from a string?
example input:
www.norway.no
www.somewhere.com
I want this output:
norway
somewhere
How can I do this?
View Replies
View Related
splitted from this thread, I need to dosomething similar i need comare 2 variables. one of them conaints the other variable but have more information
i need compare
a= "red car"
b= "red"
and then i need ask if is b in A then c=b but i dont know how.
View Replies
View Related
converting string to hex like so:
for x = 1 to len(source)
target = target & hex(ascw(mid(source,x,1)))
next
How to convert it back to a string?
I got as far as:
for x = 1 to len(source) step 2
target = target & chr("&H" & mid(source,x,2))
next
but this fails with the pound sign (£ - £)
View Replies
View Related
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.
View Replies
View Related
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:
<table>
<tr>
<td>
<Select name=ssn >
<%response.write("<option value=""" & RS("ssn") & """>" & RS("ssn") & "</option>" & vbcrlf)%></td>
<td><input type=text name=ssn value="">
</tr>
</table>
In next page when I response.write ssn, I am getting the ssn as: 123456789, why am I getting a comma next to the ssn?
View Replies
View Related
I got this huge query string that works well if I put something like this:
"select * from table"
in the table, there is a field called result wich is a varchar
so if I write "select * from table where result=" & result it says:
Microsoft OLE DB Provider for SQL Server error '80040e07'
Conversion failed when converting the varchar value 'E' to data type int.
/backoffice/ac_medica/operadores.asp, line 82
I'm gonna need the same for dates later... Can anyone tell me how?
View Replies
View Related
I am wondering if any body can guide me on how to break up a string so that i can use the first letter as a querystring.
View Replies
View Related
I need to create some .asp pages to publish data from our manufacturing lines...but I can't figure out how to establish the connection string and print the data. I've been stuck on this all day and about to start pulling my hair out!!!
As an example, can someone create the most basic code necessary to build a web page that does the following:
a) connect to a SQL version of the Northwind db (assume I have a functioning ODBC connection called 'Northwind_ODBC' on a server called 'ProductionServer')
b) Loop through the records in the [Shippers] table and paste the values in a HTML table (using SELECT * FROM SHIPPERS)
I know it sounds simple but I'm looking through some books and can't find a solution that works on my server.
NOTE: I'm running Server 2003 (with IIS), SQL Server 2000, and I have proven ASP does work on this machine...unfortunately, just not with the code I'm trying to build!!!
View Replies
View Related
Im trying to create a string from checkboxes that have been checked, but for some reason its not working
strNumbers = ""
for each key in request.form("chkFacility")
strNumbers = strNumbers + "" & key & ","
intCount = intcount + 1
next
So I want to end up with a string like this '3,12,7.' Instead Im just getting a single number. Am I doing this the right way. Any help wud be just fantastic!!
View Replies
View Related