update hyperlink through query

M

Maria

Hi,
I have created a table in a database that contains hyperlinks pointing
to various documents, all in the same folder but for some reason the
hyperlinks wouldn't work correctly unless I put the direct address in
the hyperlink.

Now the location of the document folder has changed and I need to
update the hyperlink addresses but I can't quite figure out how to do
that. I'm quite new to this... The filed shows the fliename. I need to
keep the filename and both in the visible field and at the end of the
adress but I ned to change the part of the address that points into the
folder. It's a few hundred files so it's not appealing having to do
this manualy and I'm sure it could be done through a query.

I would be very thankful for all directions.

/Maria
 
M

Maria

Hello again,

I think I might be on may way to the answer but I would still need some
help:

I realize that my query has to look something like this

UPDATE MyTable
SET Bildoriginal = (Bildoriginal - "K:\Avant Structure\Avant
Intellectual Capital AIC\Produkt\Symboler\Bildoriginal\)" &
("#\\Avantgrp\gemensam2\Avant Structure\Avant Intellectual Capital
AIC\Produkt\Symboler\Bildoriginal\" & Bildoriginal)

although not quite like this at all.

/Maria
 
X

x-rays

Hello Maria,

I think you need something like that:

Lets say that the value of your column (in that case Field1) of a row
is "D:\Avant\blabla"

UPDATE YourTable
SET Field1 = Replace(Field1, "D:\", "C:\")

Now your value is C:\Avant\blabla

Is this works for you?

PS: are you greek?
 
M

Maria

Hello x-ray,

Thankyou so much for the help. I thought your solution looked
absolutely perfect however I got an error message saying somehing like
"the expression contains a function with the wrong number of
arguments." I tried to look inte the help to understand this but I
couldn't see anything wrong.

Here's my new line of code:

UPDATE Bildoriginal
SET Bildfil = Replace(Bildfil, 'K:\', '\\Avantgrp\gemensam2\')

/Maria

Ps. No I'm not greek. I'm Swedish....
 
X

x-rays

Hello Maria,

I don't see how is that possible to fail either, eclose strings with
double quotes instead of single and tell me if works this way.

PS: oh ok, sorry for asking.
 
M

Maria

Hello again x-rays,
I tried it with double quotes first but someone told me single quotes
were more common in SQL. That's why I tried changing it. However both
ways, unfotunately, gave the same error message.

/Maria

PS. No worries... My name's common all over the world.

x-rays skrev:
 
G

Gary Walter

Replace(Bildfil, 'K:\', '\\Avantgrp\gemensam2\',1,-1,1)

if you are using Access 2000, you'll need to
write a wrapper function to use Replace.
 
M

Maria

Hello Gary,
Thank you for trying to help. I still get the same error message
though.

I use Access 2002

/Maria


Gary Walter skrev:
 
M

Maria

Like this:
UPDATE Bildoriginal
SET Bildfil = Replace(Bildfil, 'K:\', '\\Avantgrp\gemensam2\',1,-1,1));
I didn't know it had to be in SQL.

Although, I added it and still get the same error message. :-(

/Maria



x-rays skrev:
 
X

x-rays

Maria push "print screen" button when having your query window active
and e-mail to me as a file.

(e-mail address removed)
 
M

Maria

Just realized that there was a double paranthesis at the end so I
removed it. However that wasn't the problem.

UPDATE Bildoriginal
SET Bildfil = Replace(Bildfil, 'K:\', '\\Avantgrp\gemensam2\',1,-1,1);

/Maria


Maria skrev:
 
X

x-rays

ha, you have an extra parenthesis in the end. :)
Like this:
UPDATE Bildoriginal
SET Bildfil = Replace(Bildfil, 'K:\', '\\Avantgrp\gemensam2\',1,-1,1));
I didn't know it had to be in SQL.

Although, I added it and still get the same error message. :-(

/Maria



x-rays skrev:
 
G

Gary Walter

it looks like you have extra ")" at end?

else,
double-check your Help for Replace function

is there a chance that in your language version
it needs ";" instead of "," to separate parameters?

UPDATE Bildoriginal
SET Bildfil = Replace([Bildfil]; 'K:\'; '\\Avantgrp\gemensam2\';1;-1;1);
 
M

Maria

No, that generated even more errors (unknown syntax). In my help the
expression looks like:

Replace(expression, find, replace[, start[, count[, compare]]])

/Maria


Gary Walter skrev:
it looks like you have extra ")" at end?

else,
double-check your Help for Replace function

is there a chance that in your language version
it needs ";" instead of "," to separate parameters?

UPDATE Bildoriginal
SET Bildfil = Replace([Bildfil]; 'K:\'; '\\Avantgrp\gemensam2\';1;-1;1);

Maria said:
Like this:
UPDATE Bildoriginal
SET Bildfil = Replace(Bildfil, 'K:\', '\\Avantgrp\gemensam2\',1,-1,1));
I didn't know it had to be in SQL.

Although, I added it and still get the same error message. :-(

/Maria



x-rays skrev:
 
M

Maria

I keep getting delivery failure on your e-mail adress. I even tried
your gmail adress.

/Maria


x-rays skrev:
 

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

Top