...

View Full Version : Creating link between access database and website



bowser3
09-03-2007, 10:08 PM
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

Kor
09-04-2007, 09:45 AM
I guess that is a VBScript problem, not a javascript one. I might move/copy this thread to a proper Forum.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum