|
 |
asp_databases thread: Error Insert into
Message #1 by "Brian" <bgmst5@y...> on Wed, 25 Oct 2000 06:11:41 +0100
|
|
Hello,
I read some previous notes about this situation which gave me great
insight, but i still am having problems. When I did a response.write(sql)
to output the sql (which i also had to do a on error resume next to bring
up the next screen), I got the sql string:
insert into Survey (Month, Year, Question, A, B, C, D, E) values (11,
2000, 'asdf', 'sfddf', 'sdfsdf', 'sdfd', 'sdf', 'sdafdf')
There are 5 other fields that data isn't being inserted into here. The
table is structured like this:
Month (PK) - Number
Year (PK) - Number
Question - Text
A - Text
B - Text
C - Text
D - Text
E - Text
ATally - Number
BTally - Number
CTally - Number
DTally - Number
ETally - Number
I am still getting a syntax error on that statement. I think the logic is
correct, and everything is required (i have a script preventing
otherwise). I cannot see what the error is. I use a conn.execute(sql)
statement to generate the insert statement. If anybody has any insight, i
would be appreciative. Also, can anybody tell me how to request.form
something other than a textbox (if that's possible, i tried a label). I
need to request it from the form, but not allow the user to edit it.
Thank you,
Brian
Message #2 by "Ken Schaefer" <ken@a...> on Wed, 25 Oct 2000 18:11:35 +1000
|
|
And what is the error you are getting? (I'm guessing 80040e14 - Syntax Error
in INSERT INTO statement)
(I cover some here: http://www.adopenstatic.com/faq/ - if it's not there,
can you post the error message you are getting)
Cheers
Ken
----- Original Message -----
From: "Brian" <bgmst5@y...>
To: "ASP Databases" <asp_databases@p...>
Sent: Wednesday, October 25, 2000 3:11 PM
Subject: [asp_databases] Error Insert into
> Hello,
>
> I read some previous notes about this situation which gave me great
> insight, but i still am having problems. When I did a response.write(sql)
> to output the sql (which i also had to do a on error resume next to bring
> up the next screen), I got the sql string:
>
> insert into Survey (Month, Year, Question, A, B, C, D, E) values (11,
> 2000, 'asdf', 'sfddf', 'sdfsdf', 'sdfd', 'sdf', 'sdafdf')
>
> There are 5 other fields that data isn't being inserted into here. The
> table is structured like this:
>
> Month (PK) - Number
> Year (PK) - Number
> Question - Text
> A - Text
> B - Text
> C - Text
> D - Text
> E - Text
> ATally - Number
> BTally - Number
> CTally - Number
> DTally - Number
> ETally - Number
>
> I am still getting a syntax error on that statement. I think the logic is
> correct, and everything is required (i have a script preventing
> otherwise). I cannot see what the error is. I use a conn.execute(sql)
> statement to generate the insert statement. If anybody has any insight, i
> would be appreciative. Also, can anybody tell me how to request.form
> something other than a textbox (if that's possible, i tried a label). I
> need to request it from the form, but not allow the user to edit it.
>
> Thank you,
>
> Brian
>
Message #3 by Maxime Bombardier <BombardierM@s...> on Wed, 25 Oct 2000 10:46:15 -0400
|
|
First, is your database 5 not included fields supports NULL and EMPTY
values? Do they have a DEFAULT? If they don't and you try to insert
something without providing values (and there is no default), it will give
you an error. As far as syntax goes, I don't see anything.
As far as Label inside ASP/HTML, you got me there. I think that this is
only available with IE and seems to be what it should be, text for display.
In that regards, I don't think it will be returned by Request.Form
collection but if you put a NAME &/or ID to it and you can't receive the
Label's text through Request.Form, I don't believe you will get it's data.
By the way, why would you wish to retrieve that static data?
As far as any other form control, Request.Form("control_name") will retrieve
either the value or a collection of values for controls such as RADIO,
CHECK, and SELECT that contains multiple answers for the same control name.
Maxime Bombardier, MCSD, MCDBA, MCSE+I
Senior Computer Systems Analyst
Sintaks, a Canon U.S.A. division
xxx.xxx.xxxx (228)
-----Original Message-----
From: Brian [mailto:bgmst5@y...]
Sent: Wednesday, October 25, 2000 1:12 AM
To: ASP Databases
Subject: [asp_databases] Error Insert into
Hello,
I read some previous notes about this situation which gave me great
insight, but i still am having problems. When I did a response.write(sql)
to output the sql (which i also had to do a on error resume next to bring
up the next screen), I got the sql string:
insert into Survey (Month, Year, Question, A, B, C, D, E) values (11,
2000, 'asdf', 'sfddf', 'sdfsdf', 'sdfd', 'sdf', 'sdafdf')
There are 5 other fields that data isn't being inserted into here. The
table is structured like this:
Month (PK) - Number
Year (PK) - Number
Question - Text
A - Text
B - Text
C - Text
D - Text
E - Text
ATally - Number
BTally - Number
CTally - Number
DTally - Number
ETally - Number
I am still getting a syntax error on that statement. I think the logic is
correct, and everything is required (i have a script preventing
otherwise). I cannot see what the error is. I use a conn.execute(sql)
statement to generate the insert statement. If anybody has any insight, i
would be appreciative. Also, can anybody tell me how to request.form
something other than a textbox (if that's possible, i tried a label). I
need to request it from the form, but not allow the user to edit it.
Thank you,
Brian
|
|
 |