|
Creating link between access database and website
I have created a website and a search page for my access database - I keep getting the following error message -
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/07site/07site/sept4.asp, line 107
var conn = Server.CreateObject("ADODB.Connection");
--------------------------------------------------^
This is what the code on that line says
</script>
<script language="JavaScript" src="mm_menu.js"></script>
<SCRIPT> <!--
function GetDefinitions() {
window.open("Definitions.asp", "DW", "width=635,height=450,scrollbars");
}
//-->
</SCRIPT>
<%
var conn = Server.CreateObject("ADODB.Connection");
conn.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" + Server.MapPath(".") + "//Data//Housing.mdb;");
//Category
var rst1 = Server.CreateObject("ADODB.Recordset");
var CategoryRows = 0;
var sCategory = "";
rst1.CursorLocation=Application("CursorLocation.ServerSide");
rst1.CursorType=Application("CursorType.Keyset");
rst1.LockType=Application("LockType.ReadOnly");
var sql = "SELECT ID, Name FROM Category ORDER BY Name";
rst1.Open (sql, conn);
CategoryRows = rst1.RecordCount;
Any suggestions on what to do would be greatly appreciated.
Thanks
|