Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 7th, 2005, 02:20 PM
dtwilder dtwilder is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 5 dtwilder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 14 m 57 sec
Reputation Power: 0
problem with record set

I'm trying to query some data in an Access Data Project (.adp). First I build the SQL string based on user input. Part of that input defines a field to select rather than just values so I'm using a make-table query. Here's my code:

'Build SQL statement based on user input
'Query is a make-table query (needed because the user
'input defines a field to include in the results
'<snip>

'First delete the table (tblqryInvertDataSummary)
'Must add code to check if this table exists
DoCmd.DeleteObject acTable, "tblqryInvertDataSummary"

'Execute the SQL statement
DoCmd.RunSQL stSQL

'Refresh db
DoCmd.DoMenuItem acFormBar, acEditMenu, acRefresh, acMenuVer20

'Open the new table
DoCmd.OpenTable "tblqryInvertDataSummary", acViewNormal, acReadOnly



When this runs, I get an error message saying "Microsoft Office Access can't find the object tblqryInvertDataSummary". The SQL is running fine but the table won't open. If I click the menu items View-Refresh, the table shows up in the table list and when I open it, the results are there as expected. I just need to have the table automatically open. Any ideas?

Thanks,
Doug

Reply With Quote
  #2  
Old March 17th, 2006, 01:40 AM
Cool Cool is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 1 Cool User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 46 sec
Reputation Power: 0
I'm having the same problem Doug. Did you end up working out how to fix it?

Quote:
Originally Posted by dtwilder
I'm trying to query some data in an Access Data Project (.adp). First I build the SQL string based on user input. Part of that input defines a field to select rather than just values so I'm using a make-table query. Here's my code:

'Build SQL statement based on user input
'Query is a make-table query (needed because the user
'input defines a field to include in the results
'<snip>

'First delete the table (tblqryInvertDataSummary)
'Must add code to check if this table exists
DoCmd.DeleteObject acTable, "tblqryInvertDataSummary"

'Execute the SQL statement
DoCmd.RunSQL stSQL

'Refresh db
DoCmd.DoMenuItem acFormBar, acEditMenu, acRefresh, acMenuVer20

'Open the new table
DoCmd.OpenTable "tblqryInvertDataSummary", acViewNormal, acReadOnly



When this runs, I get an error message saying "Microsoft Office Access can't find the object tblqryInvertDataSummary". The SQL is running fine but the table won't open. If I click the menu items View-Refresh, the table shows up in the table list and when I open it, the results are there as expected. I just need to have the table automatically open. Any ideas?

Thanks,
Doug

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > problem with record set


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT