Error while executing a sql statement via connection string.
Error while executing a sql statement via connection string.
am 22.08.2005 16:23:01 von jack
Hi,
I am testing an application designed by a contracting party. While testing a
page
I am receiving the following error:
Error Type:
Microsoft JET Database Engine (0x80040E57)
The field is too small to accept the amount of data you attempted to add.
Try inserting or pasting less data.
/subgrantappprod/CheckAppPage.asp, line 146
I AM HAVING ERROR WITH THE LINE
146 WHICH IS: cnn.execute strSQL, , &H00000080
THE FOLLOWING IS THE CODE OF THE SQL STATEMENT GETTING UPDATED.
strSQL = "UPDATE tblApplication SET "
strSQL = strSQL & "ProjTitle = '" & eq(Request.Form("ProjTitle")) & "', "
strSQL = strSQL & "ProjStartDate = '" & StartDate & "', "
strSQL = strSQL & "ProjEndDate = '" & EndDate & "', "
strSQL = strSQL & "OtherFedSupport = '" &
trim(Request.Form("OtherFedSupport")) & "', "
if trim(Request.Form("~PrevFedMonths")) = "" then
FedMonths=0
else
FedMonths = trim(Request.Form("~PrevFedMonths"))
end if
strSQL = strSQL & "PrevFedMonthsSupport = " & FedMonths & ", "
strSQL = strSQL & "PrevFedMonthsSupportSelected = '" &
trim(Request.Form("~PrevFedMonthsSel")) & "', "
strSQL = strSQL & "PrevMBCCGrantNo = '" &
trim(Request.Form("~PrevMBCCGrantNo")) & "' "
strSQL = strSQL & "WHERE AppIntID=" & AppIntID
'The following line is inserted to get the sql string
'Response.Write strsql & "
"
'Response.End
cnn.execute strSQL, , &H00000080
However, when I am doing a response.write strsql the following is the
sql statement:
UPDATE tblApplication SET ProjTitle = 'Helping the Homeless', ProjStartDate
= '09/01/2005', ProjEndDate = '09/01/2005', OtherFedSupport = 'We do not have
any federal support for this project', PrevFedMonthsSupport = 0,
PrevFedMonthsSupportSelected = '0', PrevMBCCGrantNo = '' WHERE AppIntID=76
I can use the access database to update the record using the above statement.
However, when I let the cnn.execute run, the error comes.
Any help is appreciated. Thanks in advance.
Re: Error while executing a sql statement via connection string.
am 22.08.2005 17:21:35 von reb01501
I wonder if it's a unicode issue ...
You need to determine which field is the one that is too small. Create a
test page and update one field at a time using the data that causes the
error until you find the problem field. At this point the easiest thing to
do would be to increase the size of that field in your table.
Are you really using text fields to store dates? That's not really a good
practice ...
Jack wrote:
> Hi,
> I am testing an application designed by a contracting party. While
> testing a page
> I am receiving the following error:
>
> Error Type:
> Microsoft JET Database Engine (0x80040E57)
> The field is too small to accept the amount of data you attempted to
> add. Try inserting or pasting less data.
> /subgrantappprod/CheckAppPage.asp, line 146
>
>
> I AM HAVING ERROR WITH THE LINE
> 146 WHICH IS: cnn.execute strSQL, , &H00000080
>
> THE FOLLOWING IS THE CODE OF THE SQL STATEMENT GETTING UPDATED.
>
>
>
> However, when I am doing a response.write strsql the following is the
> sql statement:
>
>
> UPDATE tblApplication SET ProjTitle = 'Helping the Homeless',
> ProjStartDate = '09/01/2005', ProjEndDate = '09/01/2005',
> OtherFedSupport = 'We do not have any federal support for this
> project', PrevFedMonthsSupport = 0, PrevFedMonthsSupportSelected =
> '0', PrevMBCCGrantNo = '' WHERE AppIntID=76
>
> I can use the access database to update the record using the above
> statement. However, when I let the cnn.execute run, the error comes.
>
> Any help is appreciated. Thanks in advance.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Re: Error while executing a sql statement via connection string.
am 22.08.2005 17:39:47 von McKirahan
"Jack" wrote in message
news:23E71D55-1829-4411-BB52-171FCACD76D6@microsoft.com...
> Hi,
> I am testing an application designed by a contracting party. While testing
a
> page
> I am receiving the following error:
>
> Error Type:
> Microsoft JET Database Engine (0x80040E57)
> The field is too small to accept the amount of data you attempted to add.
> Try inserting or pasting less data.
> /subgrantappprod/CheckAppPage.asp, line 146
>
>
> I AM HAVING ERROR WITH THE LINE
> 146 WHICH IS: cnn.execute strSQL, , &H00000080
>
> THE FOLLOWING IS THE CODE OF THE SQL STATEMENT GETTING UPDATED.
>
>
> strSQL = "UPDATE tblApplication SET "
> strSQL = strSQL & "ProjTitle = '" & eq(Request.Form("ProjTitle")) & "', "
> strSQL = strSQL & "ProjStartDate = '" & StartDate & "', "
> strSQL = strSQL & "ProjEndDate = '" & EndDate & "', "
> strSQL = strSQL & "OtherFedSupport = '" &
> trim(Request.Form("OtherFedSupport")) & "', "
> if trim(Request.Form("~PrevFedMonths")) = "" then
> FedMonths=0
> else
> FedMonths = trim(Request.Form("~PrevFedMonths"))
> end if
> strSQL = strSQL & "PrevFedMonthsSupport = " & FedMonths & ", "
> strSQL = strSQL & "PrevFedMonthsSupportSelected = '" &
> trim(Request.Form("~PrevFedMonthsSel")) & "', "
> strSQL = strSQL & "PrevMBCCGrantNo = '" &
> trim(Request.Form("~PrevMBCCGrantNo")) & "' "
> strSQL = strSQL & "WHERE AppIntID=" & AppIntID
> 'The following line is inserted to get the sql string
> 'Response.Write strsql & "
"
> 'Response.End
>
> cnn.execute strSQL, , &H00000080
>
> However, when I am doing a response.write strsql the following is the
> sql statement:
>
>
> UPDATE tblApplication SET ProjTitle = 'Helping the Homeless',
ProjStartDate
> = '09/01/2005', ProjEndDate = '09/01/2005', OtherFedSupport = 'We do not
have
> any federal support for this project', PrevFedMonthsSupport = 0,
> PrevFedMonthsSupportSelected = '0', PrevMBCCGrantNo = '' WHERE AppIntID=76
>
> I can use the access database to update the record using the above
statement.
> However, when I let the cnn.execute run, the error comes.
>
> Any help is appreciated. Thanks in advance.
>
I suspect a Date issue. Try
strSQL = strSQL & "ProjStartDate = #" & StartDate & "#, "
strSQL = strSQL & "ProjEndDate = #" & EndDate & "#, "
Re: Error while executing a sql statement via connection string.
am 22.08.2005 17:57:03 von jack
Thanks Bob and McKirahan for the suggestion. I went to backend and saw one of
the field values is getting truncated. I increased the value of that field
and then I ran the page. This time the page did not return any error message.
Thanks for your help. Regards.
"McKirahan" wrote:
> "Jack" wrote in message
> news:23E71D55-1829-4411-BB52-171FCACD76D6@microsoft.com...
> > Hi,
> > I am testing an application designed by a contracting party. While testing
> a
> > page
> > I am receiving the following error:
> >
> > Error Type:
> > Microsoft JET Database Engine (0x80040E57)
> > The field is too small to accept the amount of data you attempted to add.
> > Try inserting or pasting less data.
> > /subgrantappprod/CheckAppPage.asp, line 146
> >
> >
> > I AM HAVING ERROR WITH THE LINE
> > 146 WHICH IS: cnn.execute strSQL, , &H00000080
> >
> > THE FOLLOWING IS THE CODE OF THE SQL STATEMENT GETTING UPDATED.
> >
> >
> > strSQL = "UPDATE tblApplication SET "
> > strSQL = strSQL & "ProjTitle = '" & eq(Request.Form("ProjTitle")) & "', "
> > strSQL = strSQL & "ProjStartDate = '" & StartDate & "', "
> > strSQL = strSQL & "ProjEndDate = '" & EndDate & "', "
> > strSQL = strSQL & "OtherFedSupport = '" &
> > trim(Request.Form("OtherFedSupport")) & "', "
> > if trim(Request.Form("~PrevFedMonths")) = "" then
> > FedMonths=0
> > else
> > FedMonths = trim(Request.Form("~PrevFedMonths"))
> > end if
> > strSQL = strSQL & "PrevFedMonthsSupport = " & FedMonths & ", "
> > strSQL = strSQL & "PrevFedMonthsSupportSelected = '" &
> > trim(Request.Form("~PrevFedMonthsSel")) & "', "
> > strSQL = strSQL & "PrevMBCCGrantNo = '" &
> > trim(Request.Form("~PrevMBCCGrantNo")) & "' "
> > strSQL = strSQL & "WHERE AppIntID=" & AppIntID
> > 'The following line is inserted to get the sql string
> > 'Response.Write strsql & "
"
> > 'Response.End
> >
> > cnn.execute strSQL, , &H00000080
> >
> > However, when I am doing a response.write strsql the following is the
> > sql statement:
> >
> >
> > UPDATE tblApplication SET ProjTitle = 'Helping the Homeless',
> ProjStartDate
> > = '09/01/2005', ProjEndDate = '09/01/2005', OtherFedSupport = 'We do not
> have
> > any federal support for this project', PrevFedMonthsSupport = 0,
> > PrevFedMonthsSupportSelected = '0', PrevMBCCGrantNo = '' WHERE AppIntID=76
> >
> > I can use the access database to update the record using the above
> statement.
> > However, when I let the cnn.execute run, the error comes.
> >
> > Any help is appreciated. Thanks in advance.
> >
>
> I suspect a Date issue. Try
>
> strSQL = strSQL & "ProjStartDate = #" & StartDate & "#, "
> strSQL = strSQL & "ProjEndDate = #" & EndDate & "#, "
>
>
>