ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 28th, 2003, 10:38 AM
storm_mind storm_mind is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 45 storm_mind User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 57 m 14 sec
Reputation Power: 5
Poll

When I try the process a vote in my poll I receive the following message error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] The INSERT INTO statement contains the following unknown field name: 'selection'. Make sure you have typed the name correctly, and try the operation again.

/panteismo/pollwrite.asp, line 17

The pollwrite's code is:

<%
u_input=request.form("u_input")
u_ip=request.servervariables("remote_addr")

accessdb="/panteismo/db/poll.mdb"
cn="driver={Microsoft Access Driver (*.mdb)};"
cn=cn & "dbq=" & server.mappath(accessdb)
set rs = server.createobject("ADODB.Recordset")
set rs1= server.createobject("ADODB.Recordset")
sql = "select ip from votos where ip ='" & u_ip & "'"

rs.Open sql, cn
if rs.eof then

sql = "insert into votos (ip, selection" & u_input & ")"
sql = sql & "values ('" & u_ip & "',1)"
rs1.Open sql, cn
response.redirect "pollresults.asp"
else
response.redirect "pollonce.html"
end if
%>

"u_input" may be 01, 02, 03... 20
The vote will be added in the database by adding a "1! in the row selection"number_chosen".

Donīt understand what is wrong... Can anyone help me to solve this problem? Thanks

Luis

Reply With Quote
  #2  
Old October 28th, 2003, 02:19 PM
jmiles jmiles is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 40 jmiles User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
kill the part where you open the connection and response.write your sql statement, then post that, so we can see whats being fed into SQL Server.
Cheers,
Justin

Edit: perhaps that wasn't clear.
comment out the connection, then response.write the sql string. post the sql string. Thx

Reply With Quote
  #3  
Old October 28th, 2003, 03:03 PM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Even better yet...

Read the error message:

The INSERT INTO statement contains the following unknown field name: 'selection'.Make sure you have typed the name correctly, and try the operation again.

This means that your INSERT INTO statement holds an unknown field name called 'selection', make sure you have typed the name correctly then retry your query.

Or if you still don't understand then use jmiles's approach, make a Response.Write of your SQL Query *BEFORE* you execute it, also add a Response.End this way you won't be executing your query for nothing.

Then copy/paste the results into Access/SQL Server and run it.
Make sure the fields you ask for are correct.

Hope this helps!
Sincerely

Vlince

Reply With Quote
  #4  
Old October 29th, 2003, 09:31 AM
storm_mind storm_mind is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 45 storm_mind User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 57 m 14 sec
Reputation Power: 5
Hi!

jmiles and Vlince, first of all thank you very much for your help. However, I must say that I'm new in asp and much of your help is misunderstood by me. Could you be a little bit more specific, please?
I know that I donīt have a field called 'selection'... What I want is to introduce the vote on selection01 if choice is "01", selection02 if choice is 02, and so on... I presume that you already know that...

I apologize for beeing so detailed...

Thank you very much for advanced help

Luis

Reply With Quote
  #5  
Old October 31st, 2003, 12:31 PM
storm_mind storm_mind is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 45 storm_mind User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 57 m 14 sec
Reputation Power: 5
Unhappy

Anyone... please...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Poll


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway