I’m trying to create the simplest database retrieval. However, I keep getting errors.
My Error message. What does it mean? How can I correct this?HTML Code:<%@ LANGUAGE="VBScript" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %> <% Dim Connection Dim RS Dim SQLStmt Dim SSN, Firstname, Lastname Dim connect_string Dim dbConn ' this code opens the database connect_string = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=employee.mdb;" dbConn = server.createObject("ADODB.connection") dbConn.open (connect_string) %> <html> <head> <title>WebForm5</title> </head> <body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server"> </form> </body> </html>
Any help would be appreciatedCode:The component 'ADODB.connection' cannot be created. Apartment threaded components can only be created on pages with an <%@ Page aspcompat=true %> page directive. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: The component 'ADODB.connection' cannot be created. Apartment threaded components can only be created on pages with an <%@ Page aspcompat=true %> page directive. Source Error: Line 18: ' this code opens the database Line 19: connect_string = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=employee.mdb;" Line 20: dbConn = server.createObject("ADODB.connection") Line 21: dbConn.open (connect_string)
Thanks




Reply With Quote