Connecting Access DB using ADODB and Jscript

I

ig.martix

I've search for a while now on how to connect a DB using ADO. What
I've found is if I put this line of code I can create the required ADO
objects.

conn = Server.CreateObject("ADODB.Connection");
rs = Server.CreateObject("ADODB.recordset");

I also have these lines at the top of the page.

<%@Language="JScript"%>
<!-- Include file for JScript ADO Constants -->
<!--#include File="adojavas.inc"-->

When I run the page it come back with an error saying:

Error "Server" is undefined

I need help. If someone could please tell what I'm missing, it would
help me a lot.
 
T

Thomas A. Rowe

Check with your web host to see if your site is configured to support JScript. The normal default
scripting language for ASP is VBScript, which is supported by FP.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
G

Guest

I think you did not provide enough code. You did not show where your database
is situated like:
conntemp.open
 
I

ig.martix

This is all the code of the page. Am I missing somethere?

I also found in the Page Options uder the Authoring tab there's a
check box for JavaScript/Jscript that's checked but it's also grayed
out. Does this matter?

<html>
<!-- Include file for JScript ADO Constants -->
<!--#include File="adojavas.inc"-->

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>Header</title>

<base target=frm_dsp>

</head>

<body>

<script language=jscript>

function test()
{

var conn = Server.CreateObject("ADODB.Connection");
var rs = Server.CreateObject("ADODB.recordset");

}

</script>

<p align="center">Input Phone Number <input type="text" name="Tin"
size="20" onblur="test();"> Market Name
<input type="text" name="Tname" size="20"> Market Number
<input type="text" name="Tcc" size="20"></p>
<p align="center">


<a href="market_info.htm">Market Info </a>&nbsp;&nbsp;&nbsp;
<a href="rentals.htm">Rentals</a>&nbsp;&nbsp;&nbsp; <a
href="delivery.htm">
Delivery</a>&nbsp;&nbsp;&nbsp; <a href="service.htm">Service</
a>&nbsp;&nbsp;&nbsp;
<a href="address_book.htm">Address Book</a>&nbsp;&nbsp;&nbsp;
<a href="sales.htm">Sales</a>&nbsp;&nbsp;&nbsp; <a
href="change_of_owner.htm">
Change of Owner</a>&nbsp;&nbsp;&nbsp; <a
href="price_descriptions.htm">Price
Descriptions</a>&nbsp;&nbsp;&nbsp; <a href="after_hours.htm">After
Hours</a></p>


</body>

</html>
 
M

Mike Mueller

All you have done is defined a data object and recordset.
What you also need is to tell what you are connecting to,
how you are connecting to it, where it is, etc

Try googling jscript ado database and go through the various
samples.

JScript generally is not used to much , in favor more of ASP
or ASP.net

: This is all the code of the page. Am I missing somethere?
:
: I also found in the Page Options uder the Authoring tab
there's a
: check box for JavaScript/Jscript that's checked but it's
also grayed
: out. Does this matter?
:
: <html>
: <!-- Include file for JScript ADO Constants -->
: <!--#include File="adojavas.inc"-->
:
: <head>
: <meta http-equiv="Content-Language" content="en-us">
: <meta http-equiv="Content-Type" content="text/html;
: charset=windows-1252">
: <title>Header</title>
:
: <base target=frm_dsp>
:
: </head>
:
: <body>
:
: <script language=jscript>
:
: function test()
: {
:
: var conn = Server.CreateObject("ADODB.Connection");
: var rs = Server.CreateObject("ADODB.recordset");
:
: }
:
: </script>
:
: <p align="center">Input Phone Number <input type="text"
name="Tin"
: size="20" onblur="test();"> Market Name
: <input type="text" name="Tname" size="20"> Market Number
: <input type="text" name="Tcc" size="20"></p>
: <p align="center">
:
:
: <a href="market_info.htm">Market Info
</a>&nbsp;&nbsp;&nbsp;
: <a href="rentals.htm">Rentals</a>&nbsp;&nbsp;&nbsp; <a
: href="delivery.htm">
: Delivery</a>&nbsp;&nbsp;&nbsp; <a
href="service.htm">Service</
: a>&nbsp;&nbsp;&nbsp;
: <a href="address_book.htm">Address
Book</a>&nbsp;&nbsp;&nbsp;
: <a href="sales.htm">Sales</a>&nbsp;&nbsp;&nbsp; <a
: href="change_of_owner.htm">
: Change of Owner</a>&nbsp;&nbsp;&nbsp; <a
: href="price_descriptions.htm">Price
: Descriptions</a>&nbsp;&nbsp;&nbsp; <a
href="after_hours.htm">After
: Hours</a></p>
:
:
: </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

Top