logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > ASP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 07-16-2008, 04:01 AM   #1
rico1931
 
Join Date: Jun 2008
Location: Buffalo
Posts: 198
Default mysql and record setting

Hi there,

I am trying to define my page to get a value from the URL in asp. I have doen the following to connect and define my record set to get the table that all the information is in and display it in order. The following is the code
Code:
<%
Dim rsProdDetail__varProduct
rsProdDetail__varProduct = "Request.QueryString("productID")"
If (BVAL <> "") Then 
  rsProdDetail__varProduct = BVAL
End If
%>
<%
Dim rsProdDetail
Dim rsProdDetail_cmd
Dim rsProdDetail_numRows

Set rsProdDetail_cmd = Server.CreateObject ("ADODB.Command")
rsProdDetail_cmd.ActiveConnection = MM_DMICSQL_STRING
rsProdDetail_cmd.CommandText = "SELECT SER_ID_Name, SER_ID, Header, SubHeader, Disclaimer, Section, Pic_UNC, Paragraph, Bullets FROM dbo.F01_Products_Detail, dbo.F01_Products WHERE dbo.F01_Products_Detail.SER_ID=dbo.F01_Products.SER_ID_Name AND dbo.F01_Products_Detail.SER_ID=?" 
rsProdDetail_cmd.Prepared = true
rsProdDetail_cmd.Parameters.Append rsProdDetail_cmd.CreateParameter("param1", 200, 1, 255, rsProdDetail__varProduct) ' adVarChar

Set rsProdDetail = rsProdDetail_cmd.Execute
rsProdDetail_numRows = 0
%>
It's suppose to get the value that is passed through the URL and sort the record set according to that. When I did the code in mysql and executed it it was fine all I did was replace '.SER_ID=?' with a value that its suppose to get from the URL. Am I doing something newbish wrong? The error that is coming up says that
Code:
rsProdDetail__varProduct = "Request.QueryString("productID")"
is expecting end statement but there is an end if statement as you can see. Any help is welcomed!

Thanks for your help!
-Xavier
rico1931 is offline   Reply With Quote
Old 08-12-2008, 10:07 AM   #2
student101
 
Join Date: Dec 2007
Posts: 379
Default

You want to pass and get a value in the URL?
Pass the value;
Code:
sompage.asp?id=<id from db>
Get the value;
In the getpage.asp page
Code:
 = Request.QueryString("id")
OR
Code:
 Dim urlval
urlval = Request.QueryString("id")
dbselect statement;
"SELECT * FROM table WHERE id = urlval"
This is all untested, just an idea.
__________________
Amateurs ... Built the ark.
Professionals ... Built the Titanic.
specificity [sound like spe-sifis-ity]
student101 is offline   Reply With Quote
Old 08-12-2008, 02:03 PM   #3
rico1931
 
Join Date: Jun 2008
Location: Buffalo
Posts: 198
Default

hey student101 thanks for the reply but i figured out what I was doing wrong. Since I was using dreamweaver to do the mysql record set for me it put this is
Code:
rsProdDetail__varProduct = "Request.QueryString("productID")"
This is wrong because the "" are not suppose to be around "Request and at the last )" . They are only suppose to be in "productID". This is why i agree with davidj that people should learn to write their own code instead of using DW to do it because it usually messes something up.
rico1931 is offline   Reply With Quote
Reply


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 On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:19 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com