Dreamweaver Club Forums

Dreamweaver Club Forums (http://www.dreamweaverclub.com/forum//index.php)
-   ASP (http://www.dreamweaverclub.com/forum//forumdisplay.php?f=187)
-   -   mysql and record setting (http://www.dreamweaverclub.com/forum//showthread.php?t=28323)

rico1931 07-16-2008 03:01 AM

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

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

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!

student101 08-12-2008 09:07 AM

You want to pass and get a value in the URL?
Pass the value;

sompage.asp?id=<id from db>
Get the value;
In the getpage.asp page

= Request.QueryString("id")

Dim urlval
urlval = Request.QueryString("id")
dbselect statement;
"SELECT * FROM table WHERE id = urlval"

This is all untested, just an idea.

rico1931 08-12-2008 01:03 PM

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

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.

All times are GMT. The time now is 10:24 AM.

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