If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Form validation inserts blank fields into database-why oh why?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #16 (permalink)  
Old 11-18-09, 04:58
mind_grapes mind_grapes is offline
Registered User
 
Join Date: Jun 2009
Location: Midlands
Posts: 133
Hi Gvee, thanks for the reply.

Arh, i am trying to run the following, and i think i've done it correctly, but clearly there is a problem so something is wrong:

Code:
str = "EXEC spNewStarter '" & formName & "','" & formSurname & "','" & formStore & "'," & formHours & ",'" & formUniform & "','" & formSex & "','" & formNI & "'"
CON.Execute(str)
The only "int" in the above is: formHours, so no single quotes, but...

...All others are varchars, and so have the single quote around them. formNI, is used for a users' National Insurance number. And as you have said 1 is still text, but it has the single quotes.


this is the sproc

Code:
ALTER PROCEDURE [dbo].[spNewStarter]
			(	
				 @formNI VARCHAR(20)
				,@formName VARCHAR(30)
				,@formSurname VARCHAR(30)
				,@formStore VARCHAR(4)
				,@formHours INT
				,@formUniform VARCHAR(4)
				,@formSex VARCHAR(1)
			)
AS

INSERT INTO [knowledge].[dbo].[NewStarter] (
				 NI
				,Name
				,Surname
				,Store
				,Hours
				,UniformSize
				,Sex
) 
VALUES (
				 @formNI
				,@formName
				,@formSurname 
				,@formStore
				,@formHours 
				,@formUniform 
				,@formSex
				)
It all seems to match, but clearly im missing something.? I think im being a dougnut, they got to be in the same order? it cant be that simple right? will try it now and check back.


Regards
MG


Quote:
Originally Posted by gvee View Post
The error is being thrown by SQL where it expects an integer and you're passing it some text.

Remember: '1' is still text (note the quotes!)
Reply With Quote
  #17 (permalink)  
Old 11-18-09, 05:25
mind_grapes mind_grapes is offline
Registered User
 
Join Date: Jun 2009
Location: Midlands
Posts: 133
Hi gvee,

Just checkin back to let you know, it worked. It was indeed the format of the sproc (what a doughnut, lol).

Thank you for all your help, it really is appreciated.

Kind regards
MG
Reply With Quote
  #18 (permalink)  
Old 11-18-09, 11:50
mind_grapes mind_grapes is offline
Registered User
 
Join Date: Jun 2009
Location: Midlands
Posts: 133
oh no, this code has knocked something else out now, But i dont know why. Do i start new thread or carry on with this??

Regards
MG
Reply With Quote
  #19 (permalink)  
Old 11-19-09, 08:36
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Hey MG,

I suggest that if it is a separate issue, then a separate thread would be appropriate
__________________
George
Twitter | Blog
Reply With Quote
  #20 (permalink)  
Old 11-19-09, 11:47
mind_grapes mind_grapes is offline
Registered User
 
Join Date: Jun 2009
Location: Midlands
Posts: 133
Hi all, i really need some help, hope someone can help me.

I had to write some vbscript that executed a stored procedure which then went to update a database - this was finally sorted but, for some reason it has caused an problem else where and i cant work out where and why this is?

The screen doesnt display an error (for example: Microsoft OLE DB Provider for SQL Server (0x80040E10) on line XXX) but the error is more to do with when a user selects and fills out a form, and then hits the submit button.

When the submit button is pressed the user is presented with a message, ("please wait while form is processed") this form then fires of to the relevant people. This message appears for all the forms, however, only the form I have been working on is processed and sent to the people that need it. For the other forms the message displays, and then freezes there, the message doesnt change, and i cant work out why?

Im guessing that the code loops or something, or I've added in my new line of code in the wrong place. I just dont know what to write and where to write it?

I'll post code but its more than the limit, so i'll have to post two additonal threads for the complete code.

pleeeease pleeease help someone. Im trying to work it out to, and will contiue to work on it.

Regards
MG
Reply With Quote
  #21 (permalink)  
Old 11-19-09, 11:52
mind_grapes mind_grapes is offline
Registered User
 
Join Date: Jun 2009
Location: Midlands
Posts: 133
Sorry, was meant to start a new thread. ignore the above thread.

Will start a new one now.

Regards
MG
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On