|
-
Feb 26th, 2003, 12:52 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED]-INSERT SQL question...
Maybe I'm a retard, but does anyone see anything wrong with this line of code?
Code:
strSQL = "INSERT INTO tblCompetitors " & _
"( strName, strStreet, strCity, strState, strZip, strManager, strP_ID ) " & _
"SELECT '" & strName & "' AS Name, " & _
"'" & strStreet & "' AS Street, " & _
"'" & strCity & "' AS City, " & _
"'" & strState & "' AS State, " & _
"'" & strZip & "' AS Zip, " & _
"'" & strManager & "' AS Manager, " & _
"'" & Session("StoreNumber") & "' AS P_ID;"
Because when it runs, it inserts ALL six fields worth of data into strName in tblCompetitors.
Thanks!
--Ben
Last edited by BenFinkel; Feb 26th, 2003 at 01:25 PM.
-
Feb 26th, 2003, 01:23 PM
#2
Frenzied Member
Re: INSERT SQL question...
Code:
strSQL = "INSERT INTO tblCompetitors " & _
"( strName, strStreet, strCity, strState, strZip, strManager, strP_ID ) " & _
"Values( '" & strName & "' AS Name, " & _
"'" & strStreet & "' AS Street, " & _
"'" & strCity & "' AS City, " & _
"'" & strState & "' AS State, " & _
"'" & strZip & "' AS Zip, " & _
"'" & strManager & "' AS Manager, " & _
"'" & Session("StoreNumber") & "' AS P_ID;)"
Try that.
-
Feb 26th, 2003, 01:24 PM
#3
Thread Starter
Hyperactive Member
Hey, thanks for the tip.
Actually, as it turns out I did a bunch of cut & pastes, and all of the data was being populated into the variable strName while the rest were blank. Stupid typo on my part.
Wish I had a good way to step-through ASP code in Interdev. Anyone know a way?
--Ben
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|