HTTP 500 error - ASP + javascript

C

Clive

Hi,

This script runs at college on the test site.

I cannot get any SQL query to run at work, even though
the same script runs at college????

I always get a HTTP 500 internal server error.

Can anyone point out what I am doing wrong????

Thanks

Clive

++++++++++++++++++++++++


<html>
<body>

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(("E:\Website\Test\ASP\test.mdb"))

set rs = Server.CreateObject("ADODB.recordset")
rs.Open "SELECT ClientID, Address FROM Employees", conn
%>

<table border="1" width="100%">
<%do until rs.EOF%>
<tr>
<%for each x in rs.Fields%>
<td><%Response.Write(x.value)%></td>
<%next
rs.MoveNext%>
</tr>
<%loop
rs.close
conn.close
%>
</table>

</body>
</html>
 
E

Evertjan.

Clive wrote on 22 mrt 2005 in comp.lang.javascript:
I always get a HTTP 500 internal server error.

first switch off "show friendly errors" in your IE browser
and then tell us the real error numbers and texts.

Your code is ASP serverside VBscript [not javascript] DB,
so posting it in this javascript NG won't do.

Restate this question in the best NG for this Q:

microsoft.public.inetserver.asp.db
 
C

Clive Swan

Ooopps put the wrong bit of code in.
This is client-side NOT server-side (right)??

The ASP pages shows-up.
The Access database is there & field - NO error BUT the ListBox is
empty????



<% @Language=Javascript %>
<%
var strTemp = " ";
var intClient = 0;
var intTemp = 0;
var strProvider = " ";
var strQuery = " ";
var rstClient;
var rstEmpProj;

intTemp = Request("cmbClients");
if (intTemp >= 1) intClient=intTemp;
else intClient = -1;
%>

<html>
<head>
<title>Scapegoat Employee/Client Relationships</title></head>

<body>

<h1 align="center"><font color="#006699">Scapegoat Employee/Client
Relationships</font></h1>
<form name="frmClient" method="POST" action="mydefault.asp">
<p align="center">Please select a client from from the list:
<select size="1" name="cmbClients">

<%
strTemp = " ";
if (intClient == -1) {
strTemp="<option selected value='-1'>";
strTemp +="Select Client..</option>";
}

strProvider="DRIVER={Microsoft Access Driver (*.mdb)}; ";
strProvider += "DBQ=E:\\Website\\Test\\ASP\\test.mdb;";
strQuery="SELECT * FROM Clients ORDER BY LastName ASC";
rstClient=Server.CreateObject("ADODB.recordset");
rstClient.Open(strQuery, strProvider);
while (! rstClient.EOF) {
intTemp = 0;
intTemp += rstClient("ClientID");
if (intTemp==intClient) strTemp += "<option selected ";
else strTemp += "<option ";
strTemp +="value='"+intTemp+"'>"+rstClient("LastName")+",
"+rstClient("FirstName")+"</option>";
rstClient.MoveNext();
}
Response.Write(strTemp);
%>
</select><input type="submit" value="GO" name="cmdGo"></p>
</FORM>

<%
if (intClient > 0) {
strTemp="<p align='center'>Employees working for: <b>";
strQuery="SELECT * FROM Clients WHERE ClientID=" + intClient;
rstClient=Server.CreateObject("ADODB.recordset");
rstClient.Open (strQuery, strProvider);
if (! rstClient.EOF) strTemp += rstClient("ClientID");
else strTemp += "<i>Unknown Client</i>";
strTemp += "</b></p><p align='center'>";
strQuery="SELECT * FROM Clients WHERE ClientID=";
strQuery += intClient;
rstEmpProj=Server.CreateObject("ADODB.recordset");
rstEmpProj.Open(strQuery, strProvider);
while (! rstEmpProj.EOF) {
strTemp += rstEmpProj ("FirstName") + ", ";
strTemp += rstEmpProj ("LastName")+ "<BR>";
rstEmpProj.MoveNext();
}
strTemp += "</p>";
Response.Write(strTemp);
}
%>

</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top