Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick help with INSERT INTO Statement

Status
Not open for further replies.

Melagan

MIS
Nov 24, 2004
443
US
Hello,

This is coming off of an ASP.NET page, using JetSQL. Does anyone see a problem with this syntax?

Code:
        "INSERT INTO tblPlayers " & _
        "(pFirst,pLast,pAge,pSex,pCity,pState,Email,Password) VALUES (" & _
        "'" & tbpFirst.Text & "'," & _
        "'" & tbpLast.Text & "'," & _
        "'" & lbpAge.SelectedValue & "'," & _
        "'" & lbpSex.SelectedValue & "'," & _
        "'" & tbpCity.Text & "'," & _
        "'" & tbpState.Text & "'," & _
        "'" & tbEmail.Text & "'," & _
        "'" & tbPassword.Text & "')"

It will not execute - giving a syntax error.

~Melagan
______
"It's never too late to become what you might have been.
 
If pAge is a numeric field, you must remove the single quotes from around that field.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
pAge is actually text, since I'm only asking the user to specify their age "group", not a specific age. The vales are pulled from a list box, which value's are:
<13
13-17
18-29
30-39
40-49
>49


~Melagan
______
"It's never too late to become what you might have been.
 
I've found out that there is some issue with my tbPassword control - it's TextMode property is set to "password". For some reason, OleDb doesn't seem to like trying to insert it's value into a regular text field. It's not a syntax issue after all - I can insert all of the fields above just fine when I leave the tbPassword control out of the statement.

As far as syntax is concerned - case closed =) Thanks.

~Melagan
______
"It's never too late to become what you might have been.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top