String Truncated
When i try to add a string to an Access db field it is truncated? here is the code :
View RepliesWhen i try to add a string to an Access db field it is truncated? here is the code :
View RepliesI'm getting a "string could be truncated" error at the line where my
strSql is executed ( my_conn.Execute (strSql) ), but it doesnt happen
all the time, just periodically. I used to have this pointing to an
Access db, but I changed it over to Sql, getting rid of the # datetime
delimiters and replacing with ' . Wondering if the first StrSql string
in the if statement if too long: Code:
i have the following update statment that this error is coming from i dont realy understand why it is thorwing the error up becuase when i was testing it i change the letter 'c' to and 'a' so not sure why it would need truncated. what does this error actual mean or what do i look for Code:
View Replies View RelatedCan't find anything in MSDN that explains this ASP error; I'm trying to post data into sql dbase, and this error points to the SQL execute line. Code:
View Replies View RelatedI am gettina an error that says "String or binary data would be truncated." I can't figure it out.
View Replies View RelatedI'm submitting data through a form with multiple rows on it, that goes out to a processing page, which then scrolls through the data row by row and sends it into a database table.
It is truncating one of the strings, the book tile string, so that if there are three words in it, only the first is getting submitted to the table. I have a feeling that it is because I have numbered the fields that are being submitted to the processing page, and therefore the field is cutting off the first word. May be wrong though about
this. Here's the code:
for x = 1 to endvalue
title=request.form("title" & x)
rest of loop code here
I have to do this in order for the procesing page to count and get the right text boxes and fields. Is there another way I can do this?
I am creating both a text and html version of the same newsletter and
sending using CDOSYS.
Both of them incorporate a list of stories drawn from a database which are
assigned to a variable storyloop.
The text version works fine, but partway throught the html version when
viewed in Outlook 2000, it goes wrong. View source shows nothing obviously
wrong, except that partway through the storyloop, it just stops and then
goes onto the next section on the email.
Outputting storyloop to the browser gives perfect results, but if I remove
all parts of the html email and just assign storyloop to the .htmlbody, I
see that after exactly 1024 characters in the resulting email, I get ------
=_NextPart_000_0057_01C59E01.6E3F5F50--
Does anyone know why this would happen, and more importantly, what I can do
to correct it?
i ve upgraded my asp application to windows 2003 +IIS 6.0 + virtual
SMTP server enabled environment from win 2000.
so i need to update the mail procedure too.(becox i used CDONTs
previously which is not supported in win 2003 by default).i have coded
my mail sending script using CDO. The problem i am now facing is the
mail message which is generated by my application is get truncated at
the receiving end..
Also i want to mention the way i coded my mailing module.
i have a vbscript function to send email that uses CDO now
and mailsending script is being called by a javascript block where i am
concatenating the mail body.
Also i dont receive mails at some personal domains. at the same time
mail reaches free domains like yahoo,hotmail gmail.
On our previous production server, we used CDONTS to attach jpeg image
to the mail. On our new server (both are Win2000) attachments are
truncated to ~108B (that's what outlook shows), or 0 bytes when I try
to save to disk from Outlook.
I'm sure that files to be attached are
accesible, because security is set to allow for Everyone. I suspect
something with SMTP config, but what? Because I couldn't find what's
wrong I moved to CDO, but the result is still the same in the end. Any
ideas?
I have several asp pages that display information from an Access DB. Some of the fields are memo fields. If I use simpler queries such as:
SELECT * FROM " & MyTabla & " WHERE " & MyCriteria
the memo fields are retrieved and displayed Ok.
However, if I use more "complicated" queries such as:
SELECT " & selecti & " FROM " & MyJoin & " GROUP BY " &grupi & " HAVING " & MyCriteria
the memo fields get truncated after the first 255 characters, i.e. only the first 255 characters are returned, but the fields are larger and get retrieved ok if I use the "simpler" queries!
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 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 RelatedI 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
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 & "%'"
It just prints on the screen: (assume name=joe)
"SELECT * FROM myTable WHERE myField LIKE 'joe'"
i have an object which is a string, (objrs4("points")) how do i convert it into int numbers.
View Replies View Relatedi 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
View Replies View RelatedI 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.
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?
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.
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 (£ - £)
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:
<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?
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?
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 RelatedI 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!!!
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!!
I am passing the following variables....
City - name of city
RentLow - low range of rent
RentHigh - high range of rent
myquery - keywords
The following is the start of my query string but I am having issues with the City portion already and I have not gotten to the rent yet
I know the SQLquery portion right below is fine - it tested perfectly, along with the rest of the query, it was when I added in the request city string that gives me No value given for one or more required parameters. even though one is passed in the string.
SQLquery = "(" &parsethis(strText ,words ,wCount, 3) & ")"
SQLquery = Replace(SQLquery, "<FIELD1>", "title")
SQLquery = Replace(SQLquery, "<FIELD2>", "description")
SQLquery = Replace(SQLquery, "<FIELD3>", "comments")
SQLstr = "SELECT * FROM links WHERE " & SQLquery & " AND city = " & Request.QueryString("city") & " AND linktype = 2 AND active = " & myTrue & " " & SortSQL & ";"
end if
Lets say I have a string like "www.ssss.com/images/theimage.jpg"
I want to parse the string and just return the image: theimage.jpg
I'm trying to create a connect string, but I might have a unique situtation. When connecting to Query Analyzer, I connect using RUNAS specifying domain and username. Is it possible to create a connect string given the above requirements? Here's what I'm trying to use:
<%
Set demoConn = Server.CreateObject("ADODB.Connection")
demoPath="DRIVER={SQL Server};" & _
"SERVER=myserver;UID=username;" & _
"PWD=pw;DATABASE=qdb"
demoConn.open demoPath
%>
I created this easy function to modify an ASP string and send the value to javascript:
Function ReplaceJS(str)
str = Replace(str,""",""")
str = Replace(str,"'","'")
ReplaceJS = Replace(str,"","")
End Function
Why I always get "empty string"? Where I'm wrong?