A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Use query name in Open recordset statement



 
 
Thread Tools Display Modes
  #1  
Old January 19th, 2006, 03:29 AM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Use query name in Open recordset statement

Hi all,
I have a database that I created which contained all the objects, including
the tabels. I then split the tables out into a back end database and we
enabled user level security. I have a statement in both databases that
looks like this:

rstClients.Open "EmailReminderMedicalVisit", , adOpenKeyset, adLockPessimistic

"EmailReminderMedicalVisit" is the name of a query .

In the non-split, no security database this works fine. In the split,
secured database, I get an error suggesting that Access excepts to see an
actual SQL statment as opposed to the name of a query. In other words,
Access isn't letting me put a query name there. I know it can be done
because it was working in the non-split database. I checked all my library
references in both databases and they identical. I know I'm missing
something. Does anyone know what may be driving this? Thank you very much,
Debbie
  #2  
Old January 19th, 2006, 11:25 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Use query name in Open recordset statement

Post the exact error message. Open accepts(expects) either.

--
Steve Clark, Access MVP
http://www.fmsinc.com/consulting
*FREE* Access Tips: http://www.fmsinc.com/free/tips.html

"Debbie" wrote in message
...
Hi all,
I have a database that I created which contained all the objects,
including
the tabels. I then split the tables out into a back end database and we
enabled user level security. I have a statement in both databases that
looks like this:

rstClients.Open "EmailReminderMedicalVisit", , adOpenKeyset,
adLockPessimistic

"EmailReminderMedicalVisit" is the name of a query .

In the non-split, no security database this works fine. In the split,
secured database, I get an error suggesting that Access excepts to see an
actual SQL statment as opposed to the name of a query. In other words,
Access isn't letting me put a query name there. I know it can be done
because it was working in the non-split database. I checked all my
library
references in both databases and they identical. I know I'm missing
something. Does anyone know what may be driving this? Thank you very
much,
Debbie



  #3  
Old January 20th, 2006, 04:35 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Use query name in Open recordset statement

Hello,
Sorry for the delay in responded - The message I get is :
Runtime error '-2147217900 (80040e14'):
Invalid SQL Statement; expected 'DELETE', 'INSERT', 'PROCEDURE','SELECT', or
'UPDATE'

If I put the actual SQL statement in, it works. I'm stumped. Thanks for
your input.
Debbie

"Debbie" wrote:

Hi all,
I have a database that I created which contained all the objects, including
the tabels. I then split the tables out into a back end database and we
enabled user level security. I have a statement in both databases that
looks like this:

rstClients.Open "EmailReminderMedicalVisit", , adOpenKeyset, adLockPessimistic

"EmailReminderMedicalVisit" is the name of a query .

In the non-split, no security database this works fine. In the split,
secured database, I get an error suggesting that Access excepts to see an
actual SQL statment as opposed to the name of a query. In other words,
Access isn't letting me put a query name there. I know it can be done
because it was working in the non-split database. I checked all my library
references in both databases and they identical. I know I'm missing
something. Does anyone know what may be driving this? Thank you very much,
Debbie

  #4  
Old January 20th, 2006, 08:15 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Use query name in Open recordset statement

adCmdText
adCmdTable
are the constants used to specify whether the value you are passing is a
Table or SQL String

rst.Open "tablename", Options:=adcmdTable


--
Steve Clark, Access MVP
http://www.fmsinc.com/consulting
*FREE* Access Tips: http://www.fmsinc.com/free/tips.html

"Debbie" wrote in message
...
Hello,
Sorry for the delay in responded - The message I get is :
Runtime error '-2147217900 (80040e14'):
Invalid SQL Statement; expected 'DELETE', 'INSERT', 'PROCEDURE','SELECT',
or
'UPDATE'

If I put the actual SQL statement in, it works. I'm stumped. Thanks for
your input.
Debbie

"Debbie" wrote:

Hi all,
I have a database that I created which contained all the objects,
including
the tabels. I then split the tables out into a back end database and we
enabled user level security. I have a statement in both databases that
looks like this:

rstClients.Open "EmailReminderMedicalVisit", , adOpenKeyset,
adLockPessimistic

"EmailReminderMedicalVisit" is the name of a query .

In the non-split, no security database this works fine. In the split,
secured database, I get an error suggesting that Access excepts to see an
actual SQL statment as opposed to the name of a query. In other words,
Access isn't letting me put a query name there. I know it can be done
because it was working in the non-split database. I checked all my
library
references in both databases and they identical. I know I'm missing
something. Does anyone know what may be driving this? Thank you very
much,
Debbie



  #5  
Old January 21st, 2006, 02:46 AM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Use query name in Open recordset statement

Steve,
I tried all the options and either got the same message or I got:
"Microsoft Access cannot find the input table/query
EmailReminderMedicalVisit. Make sure it is spelled correctly or it exists"

I don't understand, it worked fine before I split the database and put the
security on. Any other ideas? Thanks,
Debbie

"[MVP] S.Clark" wrote:

adCmdText
adCmdTable
are the constants used to specify whether the value you are passing is a
Table or SQL String

rst.Open "tablename", Options:=adcmdTable


--
Steve Clark, Access MVP
http://www.fmsinc.com/consulting
*FREE* Access Tips: http://www.fmsinc.com/free/tips.html

"Debbie" wrote in message
...
Hello,
Sorry for the delay in responded - The message I get is :
Runtime error '-2147217900 (80040e14'):
Invalid SQL Statement; expected 'DELETE', 'INSERT', 'PROCEDURE','SELECT',
or
'UPDATE'

If I put the actual SQL statement in, it works. I'm stumped. Thanks for
your input.
Debbie

"Debbie" wrote:

Hi all,
I have a database that I created which contained all the objects,
including
the tabels. I then split the tables out into a back end database and we
enabled user level security. I have a statement in both databases that
looks like this:

rstClients.Open "EmailReminderMedicalVisit", , adOpenKeyset,
adLockPessimistic

"EmailReminderMedicalVisit" is the name of a query .

In the non-split, no security database this works fine. In the split,
secured database, I get an error suggesting that Access excepts to see an
actual SQL statment as opposed to the name of a query. In other words,
Access isn't letting me put a query name there. I know it can be done
because it was working in the non-split database. I checked all my
library
references in both databases and they identical. I know I'm missing
something. Does anyone know what may be driving this? Thank you very
much,
Debbie




 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Parameter thru Form Dialog Box for REPORT Sandy Setting Up & Running Reports 16 January 10th, 2006 10:06 AM
Toolbars, Drop-Down Menus Rick New Users 1 September 21st, 2005 11:17 AM
Here's a shocker Mike Labosh General Discussion 2 October 26th, 2004 05:04 PM
Big number gives error! Sara Mellen Running & Setting Up Queries 8 October 11th, 2004 02:48 AM
Display Parameter from Form on Report sara Setting Up & Running Reports 10 July 19th, 2004 04:54 PM


All times are GMT +1. The time now is 10:35 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.