Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 317
  • Last Modified:

ASP, MySQL on Apache - Object doesn't support named arguments

I'm using ASP with MySQL on Apache

This script splits record output on a number of pages.

The Error:

Object doesn't support named arguments: 'RS.PageSize'
Object doesn't support named arguments: 'RS.CursorLocation'

The CODE:


<%'DATABASE CONNECTION%>

strConnection = "driver={MySQL};server=localhost;uid=USERNAME;pwd=PASSWORD;database=DATABASE;option=NUM"
      
<!--#include virtual="adovbs.inc" -->

<%

Page_Size = 30

If Request("Page")="" Then
Current_Page = 1
Else
Current_Page = CInt(Request("Page"))
End If

Set adoDataConn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.Connection")

RS.CursorLocation = adUseClient
RS.PageSize = Page_Size



strQuery = "SELECT * FROM news ORDER BY tblNewsDate DESC"
RS.Open strQuery,adoDataConn, AdOpenStatic, adLockReadOnly, adCmdText

%>


<% Page_Count = RS.PageCount

If 1 > Current_Page Then Current_Page = 1
If Current_Page > Page_Count Then Current_Page = Page_Count

RS.AbsolutePage = Current_Page
%>


      <%Do while not RS.AbsolutePage = Current_Page AND NOT RS.EOF%>
            
DISPLAY records HERE
            
            <%RS.MoveNext%>
      <%Loop%>

       
DISPLAY LINKS TO OTHER PAGES IF RECORD OUTPUT >30

<%
RS.Close
adoDataConn.Close
%>
0
Panavision
Asked:
Panavision
  • 3
  • 3
1 Solution
 
PanavisionAuthor Commented:
Okay, I've added
AdUseClient = 3 in the adovbs.inc file

So, Object doesn't support named arguments: 'RS.CursorLocation'  NOW works
But still get error on PageSize:

Object doesn't support named arguments: 'RS.PageSize'
0
 
ThaSmartUnoCommented:
is this supposed to be RecordSet?

Set RS = Server.CreateObject("ADODB.Connection")

this

Set RS = Server.CreateObject("ADODB.RecordSet")
0
 
PanavisionAuthor Commented:
Thanks, that's solved one problem now I get this:

ADODB.Recordset error '800a0e7d'

The connection cannot be used to perform this operation. It is either closed or invalid in this context.
refers to:

RS.Open strQuery,adoDataConn, AdOpenStatic, adLockReadOnly, adCmdText
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
ThaSmartUnoCommented:
and if you write out strQuery its an actual query right?
0
 
PanavisionAuthor Commented:
The query is fine; it seems to be an issue with ASP and MySQL.
0
 
ThaSmartUnoCommented:
sorry I cant help anymore I haven't actually tried mysql and asp since I've always been able to use access, and has always been for a small site.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now