Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Closed Thread
My Insert statement needs a trim
Old 11-16-2009, 06:01 AM My Insert statement needs a trim
Novice Talker

Posts: 8
Name: Greg
Trades: 0
Hi,

I have an insert statement that i need to refine...basically I need to trim the first couple of letters of whats trapped in the field.
so e.g.

Z:\aaa\1.jpg

needs to become

aaa\1.jpg

I've tried this but its not working

HTML Code:
sImagelink = mid(request.form("Imagelink"),4,len(request.form("Imagelink")))
any ideas?
The Mighty Dub is offline
View Public Profile
 
 
Register now for full access!
Old 11-16-2009, 06:03 AM Re: My Insert statement needs a trim
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
and the language you are trying to do this in is?

Although I'm guessing at VbScript (ASP)
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?

Last edited by chrishirst; 11-16-2009 at 06:04 AM..
chrishirst is online now
View Public Profile Visit chrishirst's homepage!
 
Old 11-16-2009, 06:12 AM Re: My Insert statement needs a trim
Novice Talker

Posts: 8
Name: Greg
Trades: 0
sorry, yes its ASP VB Script
The Mighty Dub is offline
View Public Profile
 
Old 11-16-2009, 06:45 AM Re: My Insert statement needs a trim
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
right(request.form("Imagelink"),len(request.form(" Imagelink") - 3)
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
View Public Profile Visit chrishirst's homepage!
 
Old 11-16-2009, 07:22 AM Re: My Insert statement needs a trim
Novice Talker

Posts: 8
Name: Greg
Trades: 0
Quote:
Originally Posted by chrishirst View Post
right(request.form("Imagelink"),len(request.form(" Imagelink") - 3)

Hi,

thanks for the reply but unfortunately this bit of code is cutting from the end, not the beginning. i.e.

from this
"Z:\aaa\1.jpg"

its returing
"jpg"

not
"aaa\1.jpg"

if you get my drift.
The Mighty Dub is offline
View Public Profile
 
Old 11-16-2009, 07:55 AM Re: My Insert statement needs a trim
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You may have missed out the "-"

www .modtalk.co.uk/_site/demos/right-func/
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?

Last edited by chrishirst; 11-16-2009 at 07:56 AM..
chrishirst is online now
View Public Profile Visit chrishirst's homepage!
 
Old 11-16-2009, 08:53 AM Re: My Insert statement needs a trim
Novice Talker

Posts: 8
Name: Greg
Trades: 0
Quote:
Originally Posted by chrishirst View Post
You may have missed out the "-"

www .modtalk.co.uk/_site/demos/right-func/

Hi Chris,

HTML Code:
sImagelink = right(request.form("Imagelink"),len(request.form(" Imagelink") - 3)
This is the code i am using and as you can see i am using the "-".

any other ideas?
The Mighty Dub is offline
View Public Profile
 
Old 11-16-2009, 09:32 AM Re: My Insert statement needs a trim
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
there is a missing ")"

len(request.form(" Imagelink")) - 3
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
View Public Profile Visit chrishirst's homepage!
 
Old 11-17-2009, 05:38 AM Re: My Insert statement needs a trim
Novice Talker

Posts: 8
Name: Greg
Trades: 0
Quote:
Originally Posted by chrishirst View Post
there is a missing ")"

len(request.form(" Imagelink")) - 3

Hi Chris,

That seems to have done the trick. Thank you so much for all your help.

Now something else seems to have reared its ugly head...While it strips the first three characters of the string on one machine e.g.

Z:\aaa\image.jpg to aaa\image.jpg
on another machine its not bringing through the path and skimming the first 3 letters of jpg name e.g its returning ge.jpg.

Any ideas why this may be happening?
The Mighty Dub is offline
View Public Profile
 
Old 11-17-2009, 06:00 AM Re: My Insert statement needs a trim
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You need to check what the form value contains, obviously the code is doing what it is intended to do, just what is being sent in is incorrect.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
View Public Profile Visit chrishirst's homepage!
 
Closed Thread     « Reply to My Insert statement needs a trim
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31094 seconds with 12 queries