Solved

recordsets

Posted on 2000-05-11
5
393 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
[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
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

623 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