Solved

Oracle DB with ASP

Posted on 1998-07-27
4
175 Views
Last Modified: 2013-12-25
I have an ASP application that runs fine when linked to my Access database through ODBC.  However, my end user is attaching through ODBC to an Oracle database, and things behave a little differently.  When I try to use the RecordCount or BOF properties of a recordset, I get an error that says the recordset doesn't support that property.

My main concern is to find out how many records my search returned.  Can you give me sample code that will work for an Oracle database?
0
Comment
Question by:rstone
  • 2
  • 2
4 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 200 total points
ID: 1831217
It all depends on some properties of your recordset.
If you formulate your recordset like this:

Set RS = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM table"
RS.Open strSQL, Conn, 1, 2

it supports recordcount, bookmarks and RS.MoveLast

RS.Open strSQL, Conn, 1, 3
makes the recordset updatable

the first number has to do with locking of the recordset.





0
 

Author Comment

by:rstone
ID: 1831218
OK, your code works for me, but I have a question.  Why does your code work, while this code doesn't?

Set RS = Server.CreateObject("ADODB.Recordset")
RS.CursorType = 2
RS.LockType = 1
RS.ActiveConnection = Conn
RS.Source = "SELECT * FROM table"
RS.Open

Shouldn't this do the same thing?  Instead, when I try to use the RecordCount property, I get -1.

0
 
LVL 28

Expert Comment

by:sybe
ID: 1831219
I don't know why your code does not work, where did you get that from ?

I have seen strange things happening in ASP with code that is supposed to do the same thing, but it does not. Maybe because ASP is still new and not so stable ?


0
 

Author Comment

by:rstone
ID: 1831220
I got the code from a programming book on ASP.  I was under the impression that I could either set all the parameters in one line like you suggested or I could assign values to the recordset's properties.  I guess I'll just do it the way that works.  Thanks.

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question