Quick Script

liunx

Guest
Need some help with a small script.

I have a table with about 3000 entries in it. What I need to do is change the value of a field by adding a url to the front of it.

field name: images

example:

before: 235621.jpg
after: <!-- m --><a class="postlink" href="http://domain_name/images/235621.jpg">http://domain_name/images/235621.jpg</a><!-- m -->

Help on writting a quick script to change the value would be apprecitated.

Thanks!dim conx
dim rs
dim strQuery

set conx = server.createObject("ADODB.CONNECTION")
set rs = server.createObject("ADODB.RECORDSET")

strQuery = "SELECT Images from TABLE1"

rs.Open(strquery, connDBase)
while not(rs.eof)
rs("Images") = "http://domain_name/images/" & rs("Images')
rs.update
rs.moveNext
wend
[/code]

Don't use the ADODB.Recordset very often, but that's probably your best option here.or just do an update statement..

update table1 set field1 = 'http://www.domain.com/images/' + field1I was thinking about that same statement, but doubted myself on it for some reason.

ah well - yeah, go with Afterburn's (unless you have to do different web addresses for certain cases - which it doesn't sound like you do)
 
Back
Top