Solved

Oracle DB with ASP

Posted on 1998-07-27
4
185 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

PowerShell Core for Advanced Linux Administrators

Understand advanced principals around Powershell Core with a focus on the Linux Administrator.  This course covers how to administer numerous environments across multiple platforms including Linux, Azure, AWS, and Google Cloud from a single shell instance.

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 count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

624 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