Current location: Hot Scripts Forums » Programming Languages » ASP » Passing text vs numeric data as ID from one ASP page to another


Passing text vs numeric data as ID from one ASP page to another

Reply
  #1 (permalink)  
Old 09-22-04, 04:12 AM
arobbo61 arobbo61 is offline
New Member
 
Join Date: Sep 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Passing text vs numeric data as ID from one ASP page to another

hello

am a little stuck here

in my database one very important table has its key made up of text and numeric data.

When i'm passing that key from one asp to another page using the

lngRecordNo = CLng(Request.QueryString("ID")

bit its giving a type mismatch , i'm taking it thats because CLng converts to a long integer, is there anyway i can simply pass text and numeric from one page to another ???

would really appreciate any help here .. cheers

Andy
Reply With Quote
  #2 (permalink)  
Old 09-22-04, 08:46 AM
chirag's Avatar
chirag chirag is offline
Newbie Coder
 
Join Date: May 2004
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Red face

What is the datatype of

"lngRecordNo" in database

if its alphanumeric you need not apply the clng function at all..
Reply With Quote
  #3 (permalink)  
Old 09-22-04, 08:53 AM
arobbo61 arobbo61 is offline
New Member
 
Join Date: Sep 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
thx

yes in access talk it is type text

so if i did

lngRecordNo = Request.QueryString("ID")

would that work or need any other prefix's

?

thanks for your prompt reply ... its people like you that make programming possible for beginners like me
Reply With Quote
  #4 (permalink)  
Old 09-22-04, 10:08 AM
Naresh Rohra Naresh Rohra is offline
Newbie Coder
 
Join Date: Jun 2004
Location: India
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Use Querystring in Hyperlink!

if u simply need to pass value from one page to another page u can use following statment.

Like:

<A HREF="www.Programmingtalk.com?lngRecord= <%= Request.Querystring %> "> Click </A>

This will pass the value through querystring in address bar.

Cheers.
Naresh.
Reply With Quote
  #5 (permalink)  
Old 09-23-04, 08:16 AM
arobbo61 arobbo61 is offline
New Member
 
Join Date: Sep 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
retreiving it the other end

how would i then retrieve it at the other end
?
and pass it to lngRecordNo
Reply With Quote
  #6 (permalink)  
Old 09-23-04, 08:40 AM
chirag's Avatar
chirag chirag is offline
Newbie Coder
 
Join Date: May 2004
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Cool

Hi,


you must write like:

1st page
http://abc.com?id=yourvalue

2nd page
lngRecordNo = request.querystring("id")
Reply With Quote
  #7 (permalink)  
Old 09-23-04, 09:35 AM
arobbo61 arobbo61 is offline
New Member
 
Join Date: Sep 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
THanks i tried that and still got the error message Too few parameters expected 1 .........

its not to do with your code that seems to pass the data fine just have no idea where its falling down ???
hmmm i'm fresh out of ideas with this one

thanks for your helpthough is really appreciated
Reply With Quote
  #8 (permalink)  
Old 09-24-04, 01:02 AM
chirag's Avatar
chirag chirag is offline
Newbie Coder
 
Join Date: May 2004
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Question

Can u post your code for both the files.....?
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Classified Ads skipper23 Perl 3 11-22-05 02:22 AM
Need ASP Page to Constantly Get Changing Data dkrumholz ASP.NET 0 09-06-04 05:26 AM
Classified Ads skipper23 Perl 2 12-30-03 03:43 AM
picking random entries with a filter... Double selection problem dsumpter PHP 7 11-16-03 07:19 PM


All times are GMT -5. The time now is 03:05 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.