Home > Archive > MS Access and Internet > November 2005 > A Challenging Problem I'm trying to Resolve ...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author A Challenging Problem I'm trying to Resolve ...
Wayne

2005-11-09, 3:24 am

Hi everyone,
I've got quite a specific query that I'm trying to resolve with Microsoft Access and I'm hopeful someone out there can offer a solution to my problem.

I have records that I'm displaying on a web page from an Access database and what I would like to do is include a 'Buy Now' button at the end of each record, so when the particular .aspx page is accessed through a users browser and the data pulled from the database, it looks something like the following:

Product A Description A Price A 'Buy Now Button'
Product B Description B Price B 'Buy Now Button'
Product C Description C Price C 'Buy Now Button'

I'm trying to avoid having to manually add the button to the record by way of an OLE Object field, I fear that could be really time consuming. I have some code that will work behind each button but I need to find a way around two specific problems:

Firstly, how to display the same 'Buy Now' button (or image) at the end of each record, without the necessity to add it manually to the web page - and for obvious reasons this would be a headache scenario because new records will be added and old ones deleted on a regular basis. I therefore need an automated way to include this button each time a new record is added.

The second issue I have is how to change two of the components within that code so each Buy Now button will represent the unique product it is displayed next to, for example I need to work out how to change the 'Product Name' and 'Price' within the code so its identical to the 'Product Name' and 'Price' from that particular row of data, and obviously without the necessity again to do this manually each time a new record is added.

I know this sounds complicated but I am sure there must be a way around this, perhaps using Visual Basic for Applications within the Access Database itself, but I'm not a programmer so I'm a little unsure how to apply the correct VB code to accomplish this task.

If anyone has a suitable solution for this problem I really would be grateful.

Many thanks
Wayne

As a footnote, I'm running FrontPage 2003, Access 2003 and IIS 6.0 on a Windows 2003 Datacentre Server with ASP.NET 1.1 Installed


Amy Blankenship

2005-11-10, 3:24 am

I could tell you how to do it with ASP & Notepad, but I have no idea about FrontPage & ASP.net.

Sorry;

Amy
"Wayne" < waynesmith1971(NoSpa
m)@hotmail.com> wrote in message news:egmAj6P5FHA.2364@TK2MSFTNGP12.phx.gbl...
Hi everyone,
I've got quite a specific query that I'm trying to resolve with Microsoft Access and I'm hopeful someone out there can offer a solution to my problem.

I have records that I'm displaying on a web page from an Access database and what I would like to do is include a 'Buy Now' button at the end of each record, so when the particular .aspx page is accessed through a users browser and the data pulled from the database, it looks something like the following:

Product A Description A Price A 'Buy Now Button'
Product B Description B Price B 'Buy Now Button'
Product C Description C Price C 'Buy Now Button'

I'm trying to avoid having to manually add the button to the record by way of an OLE Object field, I fear that could be really time consuming. I have some code that will work behind each button but I need to find a way around two specific problems:

Firstly, how to display the same 'Buy Now' button (or image) at the end of each record, without the necessity to add it manually to the web page - and for obvious reasons this would be a headache scenario because new records will be added and old ones deleted on a regular basis. I therefore need an automated way to include this button each time a new record is added.

The second issue I have is how to change two of the components within that code so each Buy Now button will represent the unique product it is displayed next to, for example I need to work out how to change the 'Product Name' and 'Price' within the code so its identical to the 'Product Name' and 'Price' from that particular row of data, and obviously without the necessity again to do this manually each time a new record is added.

I know this sounds complicated but I am sure there must be a way around this, perhaps using Visual Basic for Applications within the Access Database itself, but I'm not a programmer so I'm a little unsure how to apply the correct VB code to accomplish this task.

If anyone has a suitable solution for this problem I really would be grateful.

Many thanks
Wayne

As a footnote, I'm running FrontPage 2003, Access 2003 and IIS 6.0 on a Windows 2003 Datacentre Server with ASP.NET 1.1 Installed


Wayne

2005-11-10, 3:24 am

Would you mind explaining how to do it with asp Amy, I've looked at some ASP.NET web sites and it all seems a bit daunting to be honest.

Any help or step-by-step instructions you can give would be greatly appreciated.

Many thanks
Wayne

"Amy Blankenship" < Amy_nospam@magnoliam
ultimedia.com> wrote in message news:e9GgWxb5FHA.3296@TK2MSFTNGP09.phx.gbl...
I could tell you how to do it with ASP & Notepad, but I have no idea about FrontPage & ASP.net.

Sorry;

Amy
"Wayne" < waynesmith1971(NoSpa
m)@hotmail.com> wrote in message news:egmAj6P5FHA.2364@TK2MSFTNGP12.phx.gbl...
Hi everyone,
I've got quite a specific query that I'm trying to resolve with Microsoft Access and I'm hopeful someone out there can offer a solution to my problem.

I have records that I'm displaying on a web page from an Access database and what I would like to do is include a 'Buy Now' button at the end of each record, so when the particular .aspx page is accessed through a users browser and the data pulled from the database, it looks something like the following:

Product A Description A Price A 'Buy Now Button'
Product B Description B Price B 'Buy Now Button'
Product C Description C Price C 'Buy Now Button'

I'm trying to avoid having to manually add the button to the record by way of an OLE Object field, I fear that could be really time consuming. I have some code that will work behind each button but I need to find a way around two specific problems:

Firstly, how to display the same 'Buy Now' button (or image) at the end of each record, without the necessity to add it manually to the web page - and for obvious reasons this would be a headache scenario because new records will be added and old ones deleted on a regular basis. I therefore need an automated way to include this button each time a new record is added.

The second issue I have is how to change two of the components within that code so each Buy Now button will represent the unique product it is displayed next to, for example I need to work out how to change the 'Product Name' and 'Price' within the code so its identical to the 'Product Name' and 'Price' from that particular row of data, and obviously without the necessity again to do this manually each time a new record is added.

I know this sounds complicated but I am sure there must be a way around this, perhaps using Visual Basic for Applications within the Access Database itself, but I'm not a programmer so I'm a little unsure how to apply the correct VB code to accomplish this task.

If anyone has a suitable solution for this problem I really would be grateful.

Many thanks
Wayne

As a footnote, I'm running FrontPage 2003, Access 2003 and IIS 6.0 on a Windows 2003 Datacentre Server with ASP.NET 1.1 Installed


Amy Blankenship

2005-11-10, 1:24 pm

OK, let's assume for the sake of argument, that you already have a recordset, rs, with the fields Product, Description, Price, and that Product is the Primary Key to the field. Your graphic is called buynow.bmp and is in the same directory as YourFile.asp, which, at this point, is a blank html page with your open recordset code above the open html tag. I'm also assuming you don't mind sending Product in your queryString.

What we want now is a set of table rows: one for each product. So we're going to loop through the recordset:

Do While Not rs.EOF
Tabs := 2 ' number of tabs to indent, to make the code more readable
html = html & String(Tabs, vbTab) & "<TR>" & vbCR
Tabs := 3
'cel for description
html = html & String(Tabs, vbTab) & "<TD>" & rs("Description") & "</TD>" & vbCR
'cel for Price
html = html & String(Tabs, vbTab) & "<TD>" & rs("Price") & "</TD>" & vbCR
'cel for buy now
html = html & String(Tabs, vbTab) & "<TD><a href = ""./ShoppingCart.asp?Product=" & rs("Product") & """><img src=""./buynow.jpg""></a></TD>" & vbCR
rs.MoveNext
Loop

Now, between your body tags, you'll need to add

<table>
<%=html%>
</table>.

HTH;

Amy



"Amy Blankenship" < Amy_nospam@magnoliam
ultimedia.com> wrote in message news:e9GgWxb5FHA.3296@TK2MSFTNGP09.phx.gbl...
I could tell you how to do it with ASP & Notepad, but I have no idea about FrontPage & ASP.net.

Sorry;

Amy
"Wayne" < waynesmith1971(NoSpa
m)@hotmail.com> wrote in message news:egmAj6P5FHA.2364@TK2MSFTNGP12.phx.gbl...
Hi everyone,
I've got quite a specific query that I'm trying to resolve with Microsoft Access and I'm hopeful someone out there can offer a solution to my problem.

I have records that I'm displaying on a web page from an Access database and what I would like to do is include a 'Buy Now' button at the end of each record, so when the particular .aspx page is accessed through a users browser and the data pulled from the database, it looks something like the following:

Product A Description A Price A 'Buy Now Button'
Product B Description B Price B 'Buy Now Button'
Product C Description C Price C 'Buy Now Button'

I'm trying to avoid having to manually add the button to the record by way of an OLE Object field, I fear that could be really time consuming. I have some code that will work behind each button but I need to find a way around two specific problems:

Firstly, how to display the same 'Buy Now' button (or image) at the end of each record, without the necessity to add it manually to the web page - and for obvious reasons this would be a headache scenario because new records will be added and old ones deleted on a regular basis. I therefore need an automated way to include this button each time a new record is added.

The second issue I have is how to change two of the components within that code so each Buy Now button will represent the unique product it is displayed next to, for example I need to work out how to change the 'Product Name' and 'Price' within the code so its identical to the 'Product Name' and 'Price' from that particular row of data, and obviously without the necessity again to do this manually each time a new record is added.

I know this sounds complicated but I am sure there must be a way around this, perhaps using Visual Basic for Applications within the Access Database itself, but I'm not a programmer so I'm a little unsure how to apply the correct VB code to accomplish this task.

If anyone has a suitable solution for this problem I really would be grateful.

Many thanks
Wayne

As a footnote, I'm running FrontPage 2003, Access 2003 and IIS 6.0 on a Windows 2003 Datacentre Server with ASP.NET 1.1 Installed


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com