View Single Post
  #12 (permalink)  
Old August 24th, 2007, 03:46 AM
joefawcett's Avatar
joefawcett joefawcett is offline
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

You need to recognise the difference between server-side and client-side code. You have declared a
<script type="text/javascript">
element without a runat="server" attribute therefore the code runs on the client (in the browser). The client cannot run code on the server or have access to the Server object which is an object created by the ASP runtime when the server-side code is executed. If you want to create a client-side connection object then use
var conn = new ActiveXObject("ADODB.Connection");
However the remaining code won't run unless you have both lowered the browser's security settings to allow local file access and have a database at the c:\inetpub... location.


Joe (Microsoft MVP - XML)
Reply With Quote