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:
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?
I just modified a SQL table field's datatype from char to text to accomodate more text, and suddenly the results are not being displayed on my webpage. Has anyone encountered this before?
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?
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.
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.
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.
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"
this is really urgent and i cant seem to figure this out.I have his text area, once the user hits the save button, it tranfers the data to a memo datatype field in the database. ok here's the thing...every time I copy paste something, this thing throws up a wierd error..:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '('text here....
I initially though it would ahve been becuase of the number of characters, but that was not the case.When i type things in and save , e'thing works fine
I just stumbled into something which kinda of makes sense but I'm not 100% sure about.
I have a field as nvarchar.
I had the sql checking it: select blar from blar where blar = 0
weird thing is in the enterprise manager DTS the query parsed as ok. Overall the DTS failed because it came across some characters it said it couldn't handle.
The query changed to: select blar from blar where blar = '0'
and everything worked fine from there on.
---
What I'm wondering is, can nvarchar accept numeric values as well as string values?
if it can then the above all makes sense, if it doesn't... have I just found a bug?
I m updating a table which contains a field with datatype=ntext. I use a stored procedure to insert/update data in it. SP's parameter's data type is ntext. Following is the code in which i created the parameter.
Code: SET objParam1 = objComm.CreateParameter("@xmltempSrc",adLongVarChar,adParamInput,1073741823,txtXmlConte nt) objComm.Parameters.Append objParam1
when i execute it, it give error as : Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC SQL Server Driver][SQL Server]Error converting data type text to ntext.
I need to write a function that takes four inputs and returns a value based on that. For example, the inputs are name, country, state and city.
I have 25 rows and 5 columns of data. The data would be like this.
Jay, USA, CA, san francisco, san mateo, san bernadino, oakland, berkeley Mike, Canada, Ottawa, montreal, toronto, edmunton, niagara, london
if the input values are jay, usa, ca, san mateo- the function needs to return the next value in the row which is "san bernadino".
If I could store these values in the database, I could just write a query that would give me the output. But don;t want to make a trip to the database. Code:
I have a problem to use the bit field, I know that accept the value 0 like false and -1 like true.
When I do the insert into and i put value -1 i receive an arror, if i put 1 and i try to read no the database i receive ever the value false. How can i correctly use this datatype?
If execute the following sql on my MySQL database -
sqlremove = "UPDATE fib_note SET fib_note_actdone = 1 WHERE fib_note_id = '" &Request("id") &"' "
It seems to also be effecting another field in my table called fib_note_timestamp which is a timestamp data type with a default value of current_timestamp. How come and how can I stop this?
I encountered a problem where I am retrieving a field from a recordset that is in the Money datatype and I then store it into a variable, exampe;
cur_BBOAmount = rsgetBBOAmount("BBO_Amount")
I am now trying to see the contents of cur_BBOAmount but nothing is showing up. In my if statements, I checked against blanks, I checked if it was zero, and I checked if it was Null, but nothing seems to work. I checked the variable type using response.write typename(cur_BBOAmount) and that returned the Currency datatype.
My question is, how can I test the value of this variable that is of the currency datatype?
I'm updating a record by opening a recordset, setting the fields and the updating it with objRS.Update.
I need to set an image datatype to NULL. objRS("field") = NULL works for datatypes int and varchar but not for datatype image, although there is no error - the image field still contains the image!
I'm using SQL server and running an UPDATE statement including image = NULL works.
I am repeatedly getting the error message 'error converting datatype varchar to bit'. I am passing a varchar variable to a stored procedure (where it is also a varchar) and then trying to write it to a table (where it is also a varchar).
' If you use SQL Server, the connecton string must look something like this: ' Connect = "Provider=SQLOLEDB;Server=MYSRV;Database=master;UID=sa;PWD=xxx"
Set db = Server.CreateObject("ADODB.Connection") db.Open Connect
SQL = "SELECT * FROM MYIMAGES where id = " & Request("id") Set rs = db.Execute( SQL ) If rs.EOF Then Response.End
' Send actual file Response.BinaryWrite rs("image_blob")
Response.ContentType = "application/octet-stream"
' Let the browser know the file name Response.AddHeader "Content-Disposition", "attachment;filename=" & Trim(rs("filename"))
' Let the browser know the file size Response.AddHeader "Content-Length", CStr(rs("filesize"))
I have this problem in controlling a the text in a Text Area. How can I do that for example the field size is 200, when it reaches 50 it automatically goes to the next line. Bcoz im having problem when viewing it in my report, it continuesly views in a strieght line and im having problem in printing.