Solved

recordsets

Posted on 2000-05-11
5
386 Views
Last Modified: 2008-02-01
another simple question.

whats wrong with this?

objRS.Open "Products", objConn, adOpenForwardOnly, adLockReadOnly, adCmdTable

0
Comment
Question by:philcrouch
5 Comments
 
LVL 4

Expert Comment

by:CoolAss
ID: 2803453
Heheha... um... well, noting!

But that completely depends on some things:

1.) What are you trying to do?

2.) What is the error your getting.

3.) How do you define objRS and objConn?
0
 

Author Comment

by:philcrouch
ID: 2803475
i set it up like this.....


'Open a connection to the database
      Dim objConn
      Set objConn = Server.CreateObject("ADODB.Connection")
      objConn.ConnectionString = "DSN=TestDB"
      objConn.Open
      
      'Get the table information for products
      Dim objRS
      Set objRS = Server.CreateObject("ADODB.Recordset")
      objRS.Open "Products", objConn, adOpenForwardOnly, adLockReadOnly, adCmdTable
      


and get this error.  i am not sure what i am doing, but i think the paramters are for security


here is the error
Error Type:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'adOpenForwardOnly'
/members/listproducts.asp, line 35
0
 
LVL 18

Accepted Solution

by:
mgfranz earned 50 total points
ID: 2803477
You need to either define the constants with adovbs.inc include, or change the locks to numeric values.  Try this;

<!--#include file="adovbs.inc"-->



'Open a connection to the database
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=TestDB"
objConn.Open

'Get the table information for products
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "Products", objConn, adOpenForwardOnly, adLockReadOnly, adCmdTable

Or...;



'Open a connection to the database
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=TestDB"
objConn.Open

'Get the table information for products
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "Products", objConn, 3, 3


0
 
LVL 2

Expert Comment

by:bbala
ID: 2803482
the constants adopenforwardonly are defined in a file called adovbs.inc
sometimes it mey be included automatically under ur home directory, if not it may give this error either u urself include the adovbs.inc file in ur asp file or say
objrs.open "products",objconn,1,1
i.e use numbers corresponding to the constants

i am not sure of the numbers cooresponding for the constants if u want i will tell u
0
 

Author Comment

by:philcrouch
ID: 2803489
thanks for the help.....

0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 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

12 Experts available now in Live!

Get 1:1 Help Now