473,382 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Script Help Required

Hi...

I am trying to convert a simple FAQ script to access mysql db rather than
the Access db it was designed for. The originators of the script offer no
support at all.

I have managed to set up the mysql db and have frigged the script to get it
running, however certain bits are not functional, i.e. the links on the
categories.

This is where I am so far

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim Conn
Dim RSBODY
Dim CatName
Dim RS
Dim SQLBODY
Dim SQLCat
Server.ScriptTimeout = 10000000
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Driver={MySQL}; DATABASE=faqdb;UID=faq; PASSWORD=jakecat;"
Set RSBODY = Server.CreateObject("ADODB.Recordset")
SQLBODY = "SELECT * from Settings"
RSBODY.Open SQLBODY, Conn, 1, 3
If request("Action") = "Cat" Then
Set RSCat = Server.CreateObject("ADODB.Recordset")
SQLCat = "SELECT * from Categories WHERE ID=" & request("ID")
RSCat.Open SQLCat, Conn, 1, 3
CatName = RSCat("Category")
RSCat.close
Set RSCat = Nothing

Set RS = Server.CreateObject("ADODB.Recordset")
RSSQL = "SELECT * from Questions WHERE Category=" & request("ID") & " AND
NOT Pending ORDER BY Question"
RS.Open RSSQL, Conn, 1, 3

ElseIf request("Action") = "Q" Then

Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "Questions", Conn, 2, 2
RS.Find "ID=" & request("ID")
RS("Views") = RS("Views") + 1
RS.update
RS.close
Set RS = Nothing

Set RS = Server.CreateObject("ADODB.Recordset")
RSSQL = "SELECT * from Questions WHERE ID=" & request("ID") & " AND NOT
Pending"
RS.Open RSSQL, Conn, 1, 3

ElseIf request("Action") = "Search" Then

Set RS = Server.CreateObject("ADODB.Recordset")
RSSQL = "SELECT * from Questions WHERE Question LIKE '%" &
request("Keyword") & "%' OR Answer LIKE '%" & request("Keyword") & "%' AND
NOT Pending"
RS.Open RSSQL, Conn, 1, 3

ElseIf request("Action") = "New" Then

Set RS = Server.CreateObject("ADODB.Recordset")
RSSQL = "SELECT * from Questions WHERE NOT Pending ORDER BY DateCreated
Desc"
RS.Open RSSQL, Conn, 1, 3

ElseIf request("Action") = "Ask2" Then

Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "Questions", Conn, 2, 2
RS.addnew
RS("Question") = Request("Question")
RS("Category") = Request("Category")
RS("DateCreated") = Date
RS("Pending") = True
RS.update

End If
%>

Working script using access http://www.alfa-it.co.uk/faq/default.asp
(windows host)
Almost working script using mysql
http://www.automateyourgates.co.uk/faq/default.asp (apache host)

Any help much appreciated

Thanks

Chris.
Jul 20 '05 #1
0 1622

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Web Master | last post by:
Hi, I am having a little issue with Jacks Form mail php script. I have installed it and configured the form to get it to work, but for some bizarre reason I have 2 issues I can't seem to debug....
9
by: shara | last post by:
Hello there, I've a script that uses sql,php and html.I need this script to call another script.The script generates check boxes for the users to select, before the button is clicked.But after the...
3
by: traceable1 | last post by:
Is there a way I can set up a SQL script to run when the instance starts up? SQL Server 2005 SP2 thanks!
2
pradeepjain
by: pradeepjain | last post by:
<script src="getimages.php"></script> i am using this to run a script but dring validation it gives error as " Line 285, Column 51: required attribute "type" not specified. <div...
8
by: howa | last post by:
Just found a funny things.. in HTML4's dtd, http://www.w3.org/TR/html4/strict.dtd language is not valid, i.e. <!ELEMENT SCRIPT - - %Script; -- script statements --> <!ATTLIST...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.