stevepugh
08-15-2006, 07:48 AM
I have put together a test asp page and connected to a small MS access database using a DSN-less connection. When I test the connection DW8 tells me the connections was successful. i then created the recordset and tested it and I could see the records already set up in the database.
I then created a 'news' page to receive the data, the code of which is shown below (example 2).
When I run the page in Firefox or I.E I get the following error:
Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/asptestsite/news.asp, line 5
My connections file contains the following code:
<%
// FileName="Connection_ado_conn_string.htm"
// Type="ADO"
// DesigntimeType="ADO"
// HTTP="true"
// Catalog=""
// Schema=""
var MM_connenews1_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../../asptestsitedb/news.mdb")
%>
Could someone please urgently help me sort out why this does not work. It is proving very frustrating as I know I can get this working using a DSN connection but am in a position where an ISP will only use DSN-less connections.
I am running IIS 6.0 as the web server and have the newest MDAC from microsoft.
Example 2
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/connenews1.asp" -->
<%
var rsnews1 = Server.CreateObject("ADODB.Recordset");
rsnews1.ActiveConnection = MM_connenews1_STRING;
rsnews1.Source = "SELECT * FROM tblnews";
rsnews1.CursorType = 0;
rsnews1.CursorLocation = 2;
rsnews1.LockType = 1;
rsnews1.Open();
var rsnews1_numRows = 0;
%>
<%
var Repeat1__numRows = -1;
var Repeat1__index = 0;
rsnews1_numRows += Repeat1__numRows;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>news</title>
</head>
<body>
<table width="450" border="0" cellpadding="5">
<% while ((Repeat1__numRows-- != 0) && (!rsnews1.EOF)) { %>
<tr>
<td><%=(rsnews1.Fields.Item("When").Value)%></td>
<td><%=(rsnews1.Fields.Item("subject").Value)%></td>
</tr>
<tr>
<td colspan="2"><%=(rsnews1.Fields.Item("Story").Value)%></td>
</tr>
<%
Repeat1__index++;
rsnews1.MoveNext();
}
%>
</table>
</body>
</html>
<%
rsnews1.Close();
%>
I then created a 'news' page to receive the data, the code of which is shown below (example 2).
When I run the page in Firefox or I.E I get the following error:
Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/asptestsite/news.asp, line 5
My connections file contains the following code:
<%
// FileName="Connection_ado_conn_string.htm"
// Type="ADO"
// DesigntimeType="ADO"
// HTTP="true"
// Catalog=""
// Schema=""
var MM_connenews1_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../../asptestsitedb/news.mdb")
%>
Could someone please urgently help me sort out why this does not work. It is proving very frustrating as I know I can get this working using a DSN connection but am in a position where an ISP will only use DSN-less connections.
I am running IIS 6.0 as the web server and have the newest MDAC from microsoft.
Example 2
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/connenews1.asp" -->
<%
var rsnews1 = Server.CreateObject("ADODB.Recordset");
rsnews1.ActiveConnection = MM_connenews1_STRING;
rsnews1.Source = "SELECT * FROM tblnews";
rsnews1.CursorType = 0;
rsnews1.CursorLocation = 2;
rsnews1.LockType = 1;
rsnews1.Open();
var rsnews1_numRows = 0;
%>
<%
var Repeat1__numRows = -1;
var Repeat1__index = 0;
rsnews1_numRows += Repeat1__numRows;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>news</title>
</head>
<body>
<table width="450" border="0" cellpadding="5">
<% while ((Repeat1__numRows-- != 0) && (!rsnews1.EOF)) { %>
<tr>
<td><%=(rsnews1.Fields.Item("When").Value)%></td>
<td><%=(rsnews1.Fields.Item("subject").Value)%></td>
</tr>
<tr>
<td colspan="2"><%=(rsnews1.Fields.Item("Story").Value)%></td>
</tr>
<%
Repeat1__index++;
rsnews1.MoveNext();
}
%>
</table>
</body>
</html>
<%
rsnews1.Close();
%>