I have the below batch process page utilizing the Split Function. The problem is if I have a string with a comma the function splits the string into two different records. It looks at the comma as the beginning of a new record I tried to use an addtional Replace Function, but it does not seem to work with commas. Ex: Namearray(i) = Replace(BPCommentsArray(i)= , ","," "
will not work. Any suggestions of how to strip out the commas in my strings before they are processed, or how to fix my Split function in my array. Pretty ne at ASP
Thanks, Mike
Set conn = server.createobject("adodb.connection"
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "DBQ=" & server.mappath("../fpdb/PMData.mdb"
conn.Open DSNtemp
%>
<%
idarray=Split(Request("SurveyID"
,","
Namearray=Split(Request("Name"
,", "
BParray=Split(Request("BP"
,","
BPCommentsArray=Split(Request("BPComments"
,", "
BPReplyArray=Split(Request("BPReply"
,", "
for i=0 to UBound(idarray)
BPReplyarray(i) = Replace(BPReplyarray(i), "'","''"
BPCommentsArray(i)= Replace(BPCommentsArray(i),"'","''"
SQLStmt="UPDATE bsasurvey SET name = '"&Namearray(i)&"',BP = '"&BParray(i)&"', BPComments = '"&BPCommentsArray(i)&"', BPReply = '"&BPReplyarray(i)&"' WHERE SurveyID= "&idarray(i)
Response.Write(SQLStmt)
Set rs = conn.Execute(SQLstmt)
Next
%>
Thanks, Mike
Set conn = server.createobject("adodb.connection"
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "DBQ=" & server.mappath("../fpdb/PMData.mdb"
conn.Open DSNtemp
%>
<%
idarray=Split(Request("SurveyID"
Namearray=Split(Request("Name"
BParray=Split(Request("BP"
BPCommentsArray=Split(Request("BPComments"
BPReplyArray=Split(Request("BPReply"
for i=0 to UBound(idarray)
BPReplyarray(i) = Replace(BPReplyarray(i), "'","''"
BPCommentsArray(i)= Replace(BPCommentsArray(i),"'","''"
SQLStmt="UPDATE bsasurvey SET name = '"&Namearray(i)&"',BP = '"&BParray(i)&"', BPComments = '"&BPCommentsArray(i)&"', BPReply = '"&BPReplyarray(i)&"' WHERE SurveyID= "&idarray(i)
Response.Write(SQLStmt)
Set rs = conn.Execute(SQLstmt)
Next
%>