jorr1013
06-09-2003, 05:18 PM
Yes, I'm a newbie. But I'm having a problem I can't figure out.
I'm just trying to get a record count from an Access database and I can't make it work. The error simply says, "An exception occurred: 'Execute' "
The code is below. Any help will be greatly appreciated.
-John
<%@ LANGUAGE="VBSCRIPT" %>
<% OPTION EXPLICIT %>
<%
' Set up variables
Dim dcnDB ' As ADODB.Connection
Dim rsCount ' AS ADODB.Recordset
' assign Values to the variables
Set dcnDB = Server.CreateObject("ADODB.Connection")
' Open the connection to the database
dcnDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=c:\databases\ITSurvey.mdb"
dcnDB.Open
Set rsCount = dcnDB.Execute("SELECT COUNT(*) FROM Input")
Response.Write "There are "&rsCount(0)& " responses."
' Clean-up
dcnDB.Close
Set dcnDB = Nothing
%>
I'm just trying to get a record count from an Access database and I can't make it work. The error simply says, "An exception occurred: 'Execute' "
The code is below. Any help will be greatly appreciated.
-John
<%@ LANGUAGE="VBSCRIPT" %>
<% OPTION EXPLICIT %>
<%
' Set up variables
Dim dcnDB ' As ADODB.Connection
Dim rsCount ' AS ADODB.Recordset
' assign Values to the variables
Set dcnDB = Server.CreateObject("ADODB.Connection")
' Open the connection to the database
dcnDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=c:\databases\ITSurvey.mdb"
dcnDB.Open
Set rsCount = dcnDB.Execute("SELECT COUNT(*) FROM Input")
Response.Write "There are "&rsCount(0)& " responses."
' Clean-up
dcnDB.Close
Set dcnDB = Nothing
%>