Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Oracle DB with ASP

Posted on 1998-07-27
4
Medium Priority
?
190 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 600 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

972 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