Solved

Oracle DB with ASP

Posted on 1998-07-27
4
181 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

820 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