kbrown2974
01-08-2004, 09:53 AM
I have a funky problem going on with this one. I have a cookie that has multiple keys that I pull from to put into a SQL 7 table. I am having problems with 3 of the keys. The cookie data is being put into a temp variable then being inserted into the table. When I do a response.write, the data prints fine. Data type with TYPENAME is string, table field type is nvarchar. Some of the code is below. Any suggestions??
tmcounty = request.cookies("customer")("meetcounty")
tmplace = request.cookies("customer")("meetplace")
tmaddr1 = request.cookies("customer")("meetaddr1")
tmaddr2 = request.cookies("customer")("meetaddr2")
tmcity = request.cookies("customer")("meetcity")
tmstate = request.cookies("customer")("meetstate")
tmzip = request.cookies("customer")("meetzip")
tmtime = request.cookies("customer")("meettime")
tmattend = request.cookies("customer")("meetpeople")
retdate = SPLITDATE(tmtime,"D")
rettime = SPLITDATE(tmtime,"T")
cmd = "insert into highibls(inboundno,controlno,ac,number,wkac,wknumber,opid,dispn,reason,date,name,first,last,gender,a ddr1,addr2, " _
& "city,state,zip,zip4,county,ssn,birthday,age,maritalst,enrollsp,spfirst,splast,spssn,spbirthday,spage ,dependents, " _
& "elig4all,elig4medi,e_mail,p2001,f2001,meetarea,meetdate,meettime,meetcounty,meetpeople,speccare,clas sic, " _
& "prefcare,compcare,dirblue,sec65,medgap,secblue,resend,keymu,prefblue,freedom,hctc,sec65cust,heard,se c65plan, " _
& "juliandt1,juliandt2,insurer,planclate,addr165,addr265,city65,state65,zip65,zip465) values (" _
& "'" & t800 & "'," _
& "'" & tcontrol & "'," _
& "'" & thomeac & "'," _
& "'" & thomenumber & "'," _
& "'" & twkac & "'," _
& "'" & twknumber & "', " _
& "'" & topid & "', " _
& "'" & request.form("DISPO") & "', " _
& "'" & request.form("REASON") & "', " _
& "GETDATE()" & ", " _
& "'" & tname & "', " _
& "'" & tfirst & "', " _
& "'" & tlast & "', " _
& "'" & tgender & "', " _
& "'" & taddr1 & "', " _
& "'" & taddr2 & "', " _
& "'" & tcity & "', " _
& "'" & tstate & "', " _
& "'" & tzip5 & "', " _
& "'" & tzip4 & "', " _
& "'" & tcounty & "', " _
& "'" & tssn & "', " _
& "'" & tbday & "', " _
& "'" & tage & "', " _
& "'" & tstatus & "', " _
& "'" & tenroll & "', " _
& "'" & tspfirst & "', " _
& "'" & tsplast & "', " _
& "'" & tspssn & "', " _
& "'" & tspbday & "', " _
& "'" & tspage & "', " _
& "'" & tdep & "', " _
& "'" & tall & "', " _
& "'" & tmed & "', " _
& "'" & temail & "', " _
& "'" & tind & "', " _
& "'" & tfree & "', " _
& "'" & tmplace & "', " _
& "'" & CSTR(ltrim(rtrim(retdate))) & "', " _
& "'" & CSTR(ltrim(rtrim(rettime))) & "', " _
& "'" & tmcounty & "', " _
& "'" & tmattend & "', " _
& "'" & tspeccare & "', " _
& "'" & tclassic & "', " _
& "'" & tprefcare & "', " _
& "'" & tcompcare & "', " _
& "'" & tdirblue & "', " _
& "'" & tsec65 & "', " _
& "'" & tmedgap & "', " _
& "'" & tsecblue & "', " _
& "'" & tresend & "', " _
& "'" & tkeymu & "', " _
& "'" & tprefblue & "', " _
& "'" & tfreedom & "', " _
& "'" & thctc & "', " _
& "'" & tcust65 & "', " _
& "'" & trefer & "', " _
& "'" & tplantype & "', " _
& "'" & tmeda & "', " _
& "'" & tmedb & "', " _
& "'" & tinsure & "', " _
& "'" & tplanc & "', " _
& "'" & taddr165 & "', " _
& "'" & taddr265 & "', " _
& "'" & tcity65 & "', " _
& "'" & tstate65 & "', " _
& "'" & tzip565 & "', " _
& "'" & tzip465 & "')"
Function Splitdate(pvalue,pind)
DIM tval
DIM tlen
DIM colpos
DIM atpos
DIM space1
DIM space2
DIM space3
DIM plus2
DIM temp
DIM temp2
DIM temp3
DIM ampm
If pind = "D" Then
tval = LEFT(pvalue,10)
End If
If pind = "T" Then
colpos = Instr(1,pvalue,":")
atpos = Instr(1,pvalue,"@")
space1 = Instr(1,pvalue," ")
space2 = Instr(space1+1,pvalue," ")
space3 = Instr(space2+1,pvalue," ")
plus2 = space2 + 1
temp = Mid(pvalue,space2+1,space3-space2)
tlen = Len(temp)
ampm = Mid(pvalue,space3+1,1)
temp2 = "0"
temp3 = "00"
If colpos = 0 Then
tval = temp + ampm
Else
tval = Mid(pvalue,space2+1,colpos-plus2)+Mid(pvalue,colpos+1,2)+Mid(pvalue,space3+1,1)
End If
End If
Splitdate = CSTR(ltrim(rtrim(tval)))
End Function
tmcounty = request.cookies("customer")("meetcounty")
tmplace = request.cookies("customer")("meetplace")
tmaddr1 = request.cookies("customer")("meetaddr1")
tmaddr2 = request.cookies("customer")("meetaddr2")
tmcity = request.cookies("customer")("meetcity")
tmstate = request.cookies("customer")("meetstate")
tmzip = request.cookies("customer")("meetzip")
tmtime = request.cookies("customer")("meettime")
tmattend = request.cookies("customer")("meetpeople")
retdate = SPLITDATE(tmtime,"D")
rettime = SPLITDATE(tmtime,"T")
cmd = "insert into highibls(inboundno,controlno,ac,number,wkac,wknumber,opid,dispn,reason,date,name,first,last,gender,a ddr1,addr2, " _
& "city,state,zip,zip4,county,ssn,birthday,age,maritalst,enrollsp,spfirst,splast,spssn,spbirthday,spage ,dependents, " _
& "elig4all,elig4medi,e_mail,p2001,f2001,meetarea,meetdate,meettime,meetcounty,meetpeople,speccare,clas sic, " _
& "prefcare,compcare,dirblue,sec65,medgap,secblue,resend,keymu,prefblue,freedom,hctc,sec65cust,heard,se c65plan, " _
& "juliandt1,juliandt2,insurer,planclate,addr165,addr265,city65,state65,zip65,zip465) values (" _
& "'" & t800 & "'," _
& "'" & tcontrol & "'," _
& "'" & thomeac & "'," _
& "'" & thomenumber & "'," _
& "'" & twkac & "'," _
& "'" & twknumber & "', " _
& "'" & topid & "', " _
& "'" & request.form("DISPO") & "', " _
& "'" & request.form("REASON") & "', " _
& "GETDATE()" & ", " _
& "'" & tname & "', " _
& "'" & tfirst & "', " _
& "'" & tlast & "', " _
& "'" & tgender & "', " _
& "'" & taddr1 & "', " _
& "'" & taddr2 & "', " _
& "'" & tcity & "', " _
& "'" & tstate & "', " _
& "'" & tzip5 & "', " _
& "'" & tzip4 & "', " _
& "'" & tcounty & "', " _
& "'" & tssn & "', " _
& "'" & tbday & "', " _
& "'" & tage & "', " _
& "'" & tstatus & "', " _
& "'" & tenroll & "', " _
& "'" & tspfirst & "', " _
& "'" & tsplast & "', " _
& "'" & tspssn & "', " _
& "'" & tspbday & "', " _
& "'" & tspage & "', " _
& "'" & tdep & "', " _
& "'" & tall & "', " _
& "'" & tmed & "', " _
& "'" & temail & "', " _
& "'" & tind & "', " _
& "'" & tfree & "', " _
& "'" & tmplace & "', " _
& "'" & CSTR(ltrim(rtrim(retdate))) & "', " _
& "'" & CSTR(ltrim(rtrim(rettime))) & "', " _
& "'" & tmcounty & "', " _
& "'" & tmattend & "', " _
& "'" & tspeccare & "', " _
& "'" & tclassic & "', " _
& "'" & tprefcare & "', " _
& "'" & tcompcare & "', " _
& "'" & tdirblue & "', " _
& "'" & tsec65 & "', " _
& "'" & tmedgap & "', " _
& "'" & tsecblue & "', " _
& "'" & tresend & "', " _
& "'" & tkeymu & "', " _
& "'" & tprefblue & "', " _
& "'" & tfreedom & "', " _
& "'" & thctc & "', " _
& "'" & tcust65 & "', " _
& "'" & trefer & "', " _
& "'" & tplantype & "', " _
& "'" & tmeda & "', " _
& "'" & tmedb & "', " _
& "'" & tinsure & "', " _
& "'" & tplanc & "', " _
& "'" & taddr165 & "', " _
& "'" & taddr265 & "', " _
& "'" & tcity65 & "', " _
& "'" & tstate65 & "', " _
& "'" & tzip565 & "', " _
& "'" & tzip465 & "')"
Function Splitdate(pvalue,pind)
DIM tval
DIM tlen
DIM colpos
DIM atpos
DIM space1
DIM space2
DIM space3
DIM plus2
DIM temp
DIM temp2
DIM temp3
DIM ampm
If pind = "D" Then
tval = LEFT(pvalue,10)
End If
If pind = "T" Then
colpos = Instr(1,pvalue,":")
atpos = Instr(1,pvalue,"@")
space1 = Instr(1,pvalue," ")
space2 = Instr(space1+1,pvalue," ")
space3 = Instr(space2+1,pvalue," ")
plus2 = space2 + 1
temp = Mid(pvalue,space2+1,space3-space2)
tlen = Len(temp)
ampm = Mid(pvalue,space3+1,1)
temp2 = "0"
temp3 = "00"
If colpos = 0 Then
tval = temp + ampm
Else
tval = Mid(pvalue,space2+1,colpos-plus2)+Mid(pvalue,colpos+1,2)+Mid(pvalue,space3+1,1)
End If
End If
Splitdate = CSTR(ltrim(rtrim(tval)))
End Function