I'm trying to store a large amount of text in a server here, and its about well over 2000+ characters, at any given time. What type of field can house this?
I moved it up to a varchar(8000), but I'm trying to insert this data via ADO through a ASP Page, using a SPROC i created on the server.
'
I Get an errror returned: Here it is:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]The identifier that starts with 'NOVEMBER 30, 2001 Welcome to the latest edition of the FUNN 132456789 Update. If you've never received an update before, ple' is too long. Maximum length is 128.
/dev/addrelease.asp, line 6
My fields in the SPROC are varchar(8000), as well as the field in the table.
but u cant put a double quote in there
Either u assign that value to some variable and then put the variable in the sql stmt or replace it with single quote
Here is the code in the ASP page:
<% Call Connection()
Dim Info, Headline
Info = TRIM(Request.Form("info")
Headline = TRIM(Request.Form("headline")
SQL = "EXEC spPR_ReleaseInsert [" & Info & "], [" & Headline & "], 1"
objConn.Execute SQL
Call CloseConnections()
%>
I can't believe no-one's spotted the answer to this one. You've probably got some sort of delimeter in the parameter string. Try coding your db access correctly like this:
set objCmd=server.CreateObject("ADODB.command"
objCmd.ActiveConnection=objConn
objCmd.CommandText= "spPR_ReleaseInsert"
objCmd.CommandType=adCmdStoredProc
objCmd.Parameters("@NameOfParameter1"=Info
objCmd.Parameters("@NameOfParameter2"=Headline
objCmd.Parameters("@NameOfParameter3"=1
objCmd.execute
Sorry, my post was unclear. They're the name of the parameters in your stored procedure - and they need the @. Can anyone recommend a good book on data access for ASP code ? It seems there's a lot of misinformation and bad habits going around.
If it is still not working make the single quote as double guote and make the double qoute which is for Request.Form as Single quote, like this Request.Form('info') and Request.Form('headline').
Coding this way is asking for trouble. What if you have people name's like O'Brien, or some other text with single or double quotes ? Your ASP page will fall over in a heap. I think my suggestion is the best way of avoiding this. Additionally - when your code reaches objCmd.CommandType=adCmdStoredProc, ADO actually makes a call to the server to ask about the parameters including datatypes, which helps if you try and do something silly like passing text to a numeric parameter.
I forgot to mention that the ASP page will need to INCLUDE the adovbs.inc file, which I believe will be to hand on your IIS box (unless it comes with Visual Interdev). It's just a defination file of the ADO constants, like adCmdStoredProc. Kinl - please let us know if you got it working.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.