Solved

Oracle DB with ASP

Posted on 1998-07-27
4
170 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now