Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 8th, 2004, 12:00 AM
Authorized User
 
Join Date: Jun 2003
Location: Glendale, AZ, USA.
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default ADO/SQL Server RecordSet and the OrderBy Property

Hi there,
   I have an issues and can't seem to find any info on the web about it. Here is what I'm doing.

1. Open a Recordset using ADO via a stored proc in SQL Server.
2. Set the forms recordset = to the ado recordset.

This works, not problems here.

I want to set the OrderBy property to a preset string. This works if the form has not been bound to the ADO recordset, but if the form is bound and I change orderby and change the orderbyon property to true, I get the error "Data provider could not be initialized." Has anyone ran across this before.

Currently, I'm killing the datasource for the form, and then reattaching the recordset...seems like a lot of work.

One other note. The form is in datasheet view and if I use the mouse and the popup menu to change the sort order (orderby property) it works...it's the same value that I'm setting it to programatically.

Thanks in advance,
Mike
Reply With Quote
  #2 (permalink)  
Old February 8th, 2004, 02:15 PM
Authorized User
 
Join Date: Jul 2003
Location: , , Canada.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't believe the SQL is reset after attaching the recordset.
I get around this by setting the SQL directly to the recordsource property of the form:

me.Recordsource = "SELECT * FROM xxx WHERE xxx ORDER BY xxx"


Reply With Quote
  #3 (permalink)  
Old February 8th, 2004, 10:19 PM
Authorized User
 
Join Date: Jun 2003
Location: Glendale, AZ, USA.
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you set the form's record source to a SQL statement, don't the tables have to be local?

Mike
Reply With Quote
  #4 (permalink)  
Old February 9th, 2004, 11:11 AM
Authorized User
 
Join Date: Jun 2003
Location: Glendale, AZ, USA.
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you set the form's record source to a SQL statement, don't the tables have to be local? Doesn't that kind of negate using an ADO recordset that returns values fro SQL Server?

Mike
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clone DAO Recordset into ADO Recordset kamrans74 VB How-To 0 March 6th, 2007 11:57 AM
INSERT INTO from a SQL Server recordset? kcassidy Access 13 March 21st, 2006 08:35 AM
Convert ADO recordset to DAO recordset andrew_taft Access 1 May 5th, 2004 02:31 PM
ADO Recordset and SQL Statements Dataman Access VBA 4 March 21st, 2004 06:19 PM
inserting utf-8 data using ado recordset to ms sql behrang79 Classic ASP Databases 0 September 29th, 2003 07:12 AM



All times are GMT -4. The time now is 04:05 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.