?
Solved

Hwo to create a dynamic recordset?

Posted on 2003-02-18
11
Medium Priority
?
873 Views
Last Modified: 2012-06-21
I need a dynamic recordset (it has to be able to move backwards and forwards). Its contents should come from running a stored procedure on the sql server called "getcust". It should be based on a connection that does not use a DSN. I tried a bunch of examples on the net but I seem to get alot of errors. Can anyone show me a snippet that accomplishes what I need? at the moment I have :

conn.Open "Provider=SQLOLEDB; Data Source = nt1; Initial Catalog = sabre_cust; User Id = sa; Password="

If conn.errors.count = 0 Then
     set rs = conn.execute("getcust")
end if

however, it is not dynamic so it can only move forward not backward. Any help greatly aprpeciated, its driving me nuts!

0
Comment
Question by:winnydapoo
[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
  • 4
  • 3
  • 2
  • +2
11 Comments
 

Author Comment

by:winnydapoo
ID: 7978827
Note I also want dynamic so I can update the recordset, forgot to mention...
0
 

Author Comment

by:winnydapoo
ID: 7978901
Note I also want dynamic so I can update the recordset, forgot to mention...
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 7978943
Try this instead:

set objRS=Server.CreateObject("ADODB.RecordSet")
objRS.Open "getcust",conn,3,3

Fritz the Blank
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 15

Expert Comment

by:gladxml
ID: 7979029
winnydapoo,

YOU CAN TRY TO CHECK THIS OUT... MIGHT HELP...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmthmovefirstvbscriptx.asp

BTW I ALREADY TEST THE CODE BY CHANGING THE VALUES BASE ON MY EXISITNG DB...

HAPPY PROGRAMMING...
0
 
LVL 4

Expert Comment

by:Wakie
ID: 7979869
winnydapoo,

What does your SQL query look like?
0
 
LVL 5

Expert Comment

by:dgorin
ID: 7979933
You'll have to use the technique fritz the blank showed, or an ado command object.  A conn.execute() of a sql statement returns a forward-only read-only recordset.
0
 

Author Comment

by:winnydapoo
ID: 7980579
when I execute a rs.movelast using Frink's code, I get this error :

Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E24)
Rowset does not support fetching backward.

And if I try to execute a rs.moveprevious I get this error :

Error Type:
ADODB.Recordset (0x800A0C93)
Operation is not allowed in this context.
/demo.asp, line 49

What am I doing wrong?
0
 
LVL 4

Expert Comment

by:Wakie
ID: 7990220
Where is your SQL?
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 400 total points
ID: 7990392
Okay, then try this--it is a little more resource heavy:

set objRS=Server.CreateObject("ADODB.RecordSet")
objRS.Open "getcust",conn,2,3


Fritz the Blank
0
 

Author Comment

by:winnydapoo
ID: 9471754
Sorry for the delay guys, appreciate all the help!
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9477124
Glad to have helped,

Fritz the Blank
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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/…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

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