Replacing text, fails totally

J

jodleren

Hi all

I am copying data from Access to SQL server, and some strings are with
{95}, where the number is the ASCII code.

I try to replace it like this:
stemp3 = rsSource.Fields(i).value
i = InStr(stemp3, "{")
do while i > 0
j = InStr(stemp3, "}")
if j > 0 then
log("Was: " & stemp3 & ", " &Mid(stemp3, i+1, j-i-1))
response.write "<font face=""Arial"">Was: " & stemp3 &
", " &Mid(stemp3, i+1, j-i-1)&"</font><br>"
stemp3 = Mid(stemp3, 1, i-1) & Chr(CInt(Mid(stemp3, i
+1, j-i-1))) & mid(stemp3, j+1, 1000)
response.write "<font face=""Arial"">IS now: " &
stemp3 &"</font><br>"
log("IS now: " & stemp3 )
response.flush()
end if
i = InStr(i+1, stemp3, "{")
loop
stemp2 = stemp2 & "'" & Replace(stemp3, "'", "''") & "', "
'string

but only the first and last line works
if in insert the InStr or anthing else nothing happens, no output. I
need to restart the server in order to recover from that.

What can go wrong here?

WBR
Sonnich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top