|
| |
|
|
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.
|
|
|
|
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
|
|
|
|
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.
|
|
|
|
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.
|
|
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
|
|
|