472,792 Members | 4,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,792 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 1607

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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.