Hi there,
Trying to connect to an MS Access database using classic ASP and i can't seem to produce any results
, i'm going by the book and it just doesn't want to work...
All the names for the database and DSN connection seem to spelt correctly, there must be something to do with the ASP syntax that i'm missing :confusing:
Thanks for any help
Error Message
DatabaseConnect.asp
index.asp
Trying to connect to an MS Access database using classic ASP and i can't seem to produce any results

All the names for the database and DSN connection seem to spelt correctly, there must be something to do with the ASP syntax that i'm missing :confusing:
Thanks for any help

Error Message
Error Type:
Microsoft VBScript runtime (0x800A01C2)
Wrong number of arguments or invalid property assignment
Website/index.asp, line 55
DatabaseConnect.asp
Code:
<%
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=littercode_cms"
objConn.Open
%>
index.asp
Code:
<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include file="Connections/DatabaseConnect.asp"-->
<%
Const adOpenForwardOnly = 0
Const adLockOptimistic = 3
Const adLockPessimistic = 2
Const adLockReadOnly = 1
Const adCmdTable = 2
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="insert variable for website description here" />
<meta name="keywords" content="insert variable for website keywords" />
<title>Untitled</title>
<link rel="stylesheet" type="text/css" title="default" href="styles.css">
<script language="JavaScript1.2" type="text/javascript">
function clearDefault(el)
{
if (el.defaultValue==el.value) el.value = ""
}
</script>
</head>
<body>
<div id="header"></div>
<div id="wrapper">
<div id="logoheader">
<div id="logoheaderleft">
<h1>Test Header</h1>
</div>
<div id="logoheaderright">
<div id="logoheaderlinks">
<a href="#" title="">Home</a>
<a href="#" title="">About</a>
<a href="#" title="">Sitemap</a>
<a href="#" title="">Contact</a>
</div>
<div id="search-textonly">
</div>
</div>
</div><!-- end of logoheader-->
<div id="navheader">
<%
Dim objRS
Set objRS = Server.CreateObject ("ADODB.Recordset")
objRS.Open "tblMenu", objConn, , , adCmdTable
%>
<ul>
<%Do While Not objRS.EOF%>
<li><a href="index.asp?pg=<%objRS("IntLinkAddress")%>" title="<%objRS("Name")%>"%>><%objRS("Name")%></a></li>
<%objRS.MoveNext%>
<%Loop
'closing the recordset connection
objRS.Close
Set objRS = Nothing
%>
</ul>
</div><!-- end of navheader -->
<div id="navlower">
<form action="" method="post" name="search" class="searchform">
<input type="text" name="search" value="Start new search" onfocus="javascript:clearDefault(this)" class="searchinput" /><input type="submit" name="searchs" id="" class="searchsubmit" value="Go" />
</form>
<a href="#" title="Text-only" class="textonly">Text-only</a>
</div>
<div id="leftcol">
<ul>
<li><a href="#">Sub Section 3</a></li>
<li><a href="#">Sub Section 3</a></li>
<li><a href="#">Sub Section 3</a></li>
<li><a href="#">Sub Section 3</a></li>
<li><a href="#">Sub Section 3</a></li>
<li><a href="#">Sub Section 3</a></li>
<li><a href="#">Sub Section 3</a></li>
<li><a href="#">Sub Section 3</a></li>
<li><a href="#">Sub Section 3</a></li>
</ul>
</div>
<div id="rightcol">
</div>
<div id="footer">footer test</div>
</div><!-- end of #wrapper -->
</body>
</html>
<%
'close the dsn connection
objConn.Close
Set objConn = Nothing
%>