I am in a time crunch to get mysql working on my site.  I export inventory
records out of my Peachtree software into Excel and planned to use that .xls
table to show product pricing and availability on my web pages.  Below is
sample asp code that works.  My ISP had told me they support asp, but after
coding and testing (at another site), I found that my ISP really doesn't
support asp.  Can anyone provide a sample chunk of mysql code that would do
what this asp code does...

--------------

At the top of the page, setting the connection to the .xls (would be
slightly different for a database connection):

<%@ Language=VBScript %>
<%Option Explicit%>
<%
 'Declare Variables
 Dim cnnExcel, rsProduct, strSQL
 'Connection Object
 set cnnExcel = server.createobject("ADODB.Connection")
 cnnExcel.Open "DRIVER={Microsoft Excel Driver (*.xls)};DBQ=" &
server.MapPath("../catalog.xls") & ";"
 'RecordObject
 set rsProduct = server.CreateObject("ADODB.recordset")
%>

Next to each product is this code, it shows the price and qty from the file
and an image with a hyperlink if qty > 0:

<%
    'Code for checking inventory
    'SQL
    strSQl = "SELECT * FROM [Sheet1$] WHERE ((([Sheet1$].[Product
Code])='blizzard'))"
 'Open Recordset
    rsProduct.Open strSQl, cnnExcel
    if not rsProduct.EOF then
  Response.Write "Price: $" & rsProduct.Fields("Price").Value & "<br><br>"
  Response.Write "Quantity on Hand: " & rsProduct.Fields("Qty in
Stock").Value & "<br><br>"
  if rsProduct.Fields("Qty in Stock").Value > 0 then
   Response.Write "<a href=""url here""><img src=""images/button.gif""></a>"
  end if
    end if
        %>

The bottom of the page closes the connection:

<%
'Close Objects
rsProduct.Close
Set rsProduct = Nothing
cnnExcel.Close
Set cnnExcel = Nothing
%>

-----------------------------

Thanks in advance if anyone can give me direction on how to accomplish this!

Joe.


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to