M
middletree
Sorry for starting a new thread, but the original was 24 hours ago, and I am
afraid it won't get seen.
In the original, Ray advised me to change
if len(strPeopleID)>0 then
arrPeople = SPLIT(strPeople,",")
for x=lbound(arrPeople) to ubound(arrPeople)
strSQL = "INSERT into PersonalPeople(PersonalID,PeopleID) "
strSQL = strSQL & "VALUES('"&strPersonalID&"','"&strPeopleID(x)&"')"
response.write strSQL
response.end
objConnection.Execute strSQL
next
end if
to
if len(strPeopleID)>0 then
arrPeople = SPLIT(strPeople,",")
for x=lbound(arrPeople) to ubound(arrPeople)
strSQL = "INSERT into PersonalPeople(PersonalID,PeopleID) "
strSQL = strSQL & "VALUES('"&strPersonalID&"','"&arrPeople(x)&"')"
response.write strSQL
response.end
objConnection.Execute strSQL
next
end if
(the difference is in the VALUES line, last part)
I did the change, but same result. I'm gettiung pretty desperate, as I have
spent countless hours on this one thing. Any help would be appreciated.
Below is the entire original description of the problem:
I think you'd want to insert arrPeople(x) there instead of strPeopleID.
strPeopleID will equal something like "2, 3, 6, 8, 32, 49"
Also, when you Split() strPeopleID, split by ", " instead of "," or
replace(strPeopleID, ", ", ",") before splitting. There are spaces after
the commas.
Also, is PeopleID a text type column? You have it delimited with '.
Another thing is that you should put spaces after (at least) the &
concatenation operator. If you don't, you'll run into issues if you have a
variable name that starts with an "h" as &h indicates a hex value is to
follow.
Ray at home
afraid it won't get seen.
In the original, Ray advised me to change
if len(strPeopleID)>0 then
arrPeople = SPLIT(strPeople,",")
for x=lbound(arrPeople) to ubound(arrPeople)
strSQL = "INSERT into PersonalPeople(PersonalID,PeopleID) "
strSQL = strSQL & "VALUES('"&strPersonalID&"','"&strPeopleID(x)&"')"
response.write strSQL
response.end
objConnection.Execute strSQL
next
end if
to
if len(strPeopleID)>0 then
arrPeople = SPLIT(strPeople,",")
for x=lbound(arrPeople) to ubound(arrPeople)
strSQL = "INSERT into PersonalPeople(PersonalID,PeopleID) "
strSQL = strSQL & "VALUES('"&strPersonalID&"','"&arrPeople(x)&"')"
response.write strSQL
response.end
objConnection.Execute strSQL
next
end if
(the difference is in the VALUES line, last part)
I did the change, but same result. I'm gettiung pretty desperate, as I have
spent countless hours on this one thing. Any help would be appreciated.
Below is the entire original description of the problem:
set rs = objConnection.execute("select MAX(PersonalID) from Personal")
'response.write "New ID was " & rs(0)
strPersonalID = rs(0)
objConnection.Close
Set objConnection = nothing
'these three will pull from the checkboxes, should give a string
Set objConnection = Server.CreateObject("ADODB.Connection")
objConnection.ConnectionString = strConnection
objConnection.Open
strPeopleID = request.form("People")
if len(strPeopleID)>0 then
arrPeople = SPLIT(strPeople,",")
for x=lbound(arrPeople) to ubound(arrPeople)
strSQL = "INSERT into PersonalPeople(PersonalID,PeopleID) "
strSQL = strSQL & "VALUES('"&strPersonalID&"','"&strPeopleID&"')"
I think you'd want to insert arrPeople(x) there instead of strPeopleID.
strPeopleID will equal something like "2, 3, 6, 8, 32, 49"
Also, when you Split() strPeopleID, split by ", " instead of "," or
replace(strPeopleID, ", ", ",") before splitting. There are spaces after
the commas.
Also, is PeopleID a text type column? You have it delimited with '.
Another thing is that you should put spaces after (at least) the &
concatenation operator. If you don't, you'll run into issues if you have a
variable name that starts with an "h" as &h indicates a hex value is to
follow.
Ray at home