MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

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:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old April 28th, 2004, 04:40 PM
anoyes anoyes is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: MA, USA
Posts: 38 anoyes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Field blank when inserting record

Hi,
I'm having a problem with the INSERT statement below. Without sending back any errors, the record is inserted minus the clue field (txtClue on the form). Everything else inserts fine. Any ideas? Thanks

Code:
insert.CommandText = "INSERT INTO tblUsers (password, email, active, access, firstName, lastName, company, customernumber, clue, answer) " &_
"VALUES ('" & Request.Form("txtPassword") & "', '" & Request.Form("txtEMail") & "', 'no', 'user', '" &_
Request.Form("txtFirstName") & "', '" & Request.Form("txtLastName") & "', '" & Request.Form("txtCompany") &_
"', " & Request.Form("txtCustomerNumber") & ", '" & Request.Form("txtClue") & "', '" & Request.Form("txtAnswer") & "')"

Reply With Quote
  #2  
Old April 28th, 2004, 09:28 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 25th Plane (17000 - 17499 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 17,344 r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 5 Days 8 h 26 m 34 sec
Reputation Power: 891
well, if the row does get inserted, what gets put into the field? a null? a zero-length string? a blank?

are you sure the form actually has a field called txtClue?
__________________
r937.com | rudy.ca

Reply With Quote
  #3  
Old April 29th, 2004, 04:36 AM
pdo pdo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 3 pdo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Try debugging it first by outputting what "would" be executed. i.e. do something like this:

Code:
Response.Write "INSERT INTO tblUsers (password, email, active, access, firstName, lastName, company, customernumber, clue, answer) " &_
"VALUES ('" & Request.Form("txtPassword") & "', '" & Request.Form("txtEMail") & "', 'no', 'user', '" &_
Request.Form("txtFirstName") & "', '" & Request.Form("txtLastName") & "', '" & Request.Form("txtCompany") &_
"', " & Request.Form("txtCustomerNumber") & ", '" & Request.Form("txtClue") & "', '" & Request.Form("txtAnswer") & "')"
Response.End


Then if the "txtClue" field is blank, you have an ASP problem (i.e. the "txtClue" field is not submitted from the posting page).

Reply With Quote
  #4  
Old April 29th, 2004, 04:34 PM
anoyes anoyes is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: MA, USA
Posts: 38 anoyes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
I tried doing response.write for the insert statement, and everything displays as it should. the field 'txtClue' does get sent to the insert statement.

In response to the question of what gets put in the field, nothing. When I pull the db up in Access, it's just an empty field w/ no value.

Reply With Quote
  #5  
Old April 29th, 2004, 05:03 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 25th Plane (17000 - 17499 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 17,344 r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 5 Days 8 h 26 m 34 sec
Reputation Power: 891
can you show us the response-written string?

"nothing" could mean either null or a non-null zero-length string

Reply With Quote
  #6  
Old April 30th, 2004, 03:04 PM
anoyes anoyes is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: MA, USA
Posts: 38 anoyes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
The Response.Write output is:

Code:
INSERT INTO tblUsers (password, email, active, access, firstName, lastName, company, customernumber, clue, answer) VALUES ('1234', 'jdoe@abdcompany.com', 'no', 'user', 'John', 'Doe', 'ABC Company, Inc.', 1234, 'my question', 'my answer')

Reply With Quote
  #7  
Old April 30th, 2004, 03:29 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 25th Plane (17000 - 17499 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 17,344 r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 5 Days 8 h 26 m 34 sec
Reputation Power: 891
well, that sure looks right, doesn't it

i have no idea

Reply With Quote
  #8  
Old May 8th, 2004, 02:17 PM
anoyes anoyes is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: MA, USA
Posts: 38 anoyes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Exclamation

anyone.....please

Reply With Quote
  #9  
Old May 11th, 2004, 05:49 AM
Zveroa Zveroa is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 6 Zveroa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
If the 'clue' is varchar, the insert should work. You should assign all parameters to the insert to variables before adding them to the INSERT statement. In this way you set a breakpoint and see the actual value of the variables. I suppose you are using VB or similar and you are able to set break points?

sPassword = Request.Form("txtPassword")
sEMail = Request.Form("txtEMail")
sClue = Request.Form("txtClue")

insertStatement = "XXXX " & sClue & "XXX"
db.execute(insertStatement)

or something like this. The large statements you are using in the initial posting are ALWAYS difficult to debug. If this doesn't help, you might want to try to change the datatype of the clue column.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Field blank when inserting record


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 1 hosted by Hostway