a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions. dd

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Inserting an alpha value

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Inserting an alpha value
Page: [1]
 
adam2804

 

Posts: 34
Joined: 6/6/2006
Status: offline

 
Inserting an alpha value - 8/3/2006 17:31:00   
Hello people,

I have a problem inserting an alpha value into my database from a Request("Field") statement.

My code reads something like (appologies as I haven't got the source code here):

SQL = "INSERT INTO Table (ID, CompanyName, Price, Reference)"
SQL = SQL "VALUES Request("ID") & "," & Request("CompanyName") & ", " & Request(Price) & ", " & Request("Reference")

The value 'Reference' I need inserting into the database as an alpha, because at the moment a value such as '01' is being inserted as '1', and a value such as 'AB' is being rejected.

Has anyone got any ideas about this? I don't want to really re-write the statement as there's about 8 of these statements on the page in question and am worried about effecting too much of the page.

Thanks,

Adam

Thanks
BeTheBall

 

Posts: 6385
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Inserting an alpha value - 8/3/2006 19:33:13   
When inserting a text entry, you surround the value with single quotes. For example,

SQL = "INSERT INTO Table (ID, CompanyName, Price, Reference)"
SQL = SQL "VALUES Request("ID") & "," & Request("CompanyName") & ", " & Request(Price) & ", '" & Request("Reference")'

Are you sure CompanyName isn't text as well?


_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to adam2804)
yb2

 

Posts: 653
Joined: 1/30/2006
Status: offline

 
RE: Inserting an alpha value - 8/3/2006 19:34:27   
what's the database?

_____________________________

it is natural for people not to see one's own faults, and to exaggerate other people's faults and failings.
Currently listening to: L'Enfer Des Formes by Stereolab

(in reply to adam2804)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Inserting an alpha value - 8/3/2006 22:04:20   
quote:

SQL = SQL "VALUES Request("ID") & ","...


I'm pretty sure that part is a problem:

SQL = SQL & "VALUES (" & Request("ID") & ","

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to yb2)
dzirkelb1

 

Posts: 1324
Joined: 10/5/2004
From: Cedar Rapids, Iowa
Status: offline

 
RE: Inserting an alpha value - 8/4/2006 15:21:44   
It really sounds like your field is labled as a text field, which is why 01 is being converted to 1, and ab is rejected.

(in reply to rdouglass)
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> ASP and Database >> Inserting an alpha value
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts