Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql query not running from event procedure

Status
Not open for further replies.

wh0wants2know

IS-IT--Management
Mar 23, 2005
10
US
I have an access project with several linked tables from a sql server. The tables are linked through a file dsn and i can view the data in them. I also have a query in access that runs on the linked tables and some of the local tables simultaneously. When I run that query by double-clicking it, it works just fine. when I try to run that SAME QUERY from an event procedure, it hangs. i noticed that when I run the query by double-clicking, it asks me for a username and password to connect to the sql database and I have to change it from my windows logon to my sql server account, but when I try to run this as an event procedure, it doesn't prompt me for anything, and I think that this is likely the cause. Is there any way to make this thing work from my code? the code is:

dbDb.QueryDefs!PO_Mawb_Xref_View.Execute

and PO_Mawb_Xref_View is a query that I have created in the access project.
 
You may tick the remember password checkbox when you link the tables.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
This is all well and good for me, but I have a lot of other users who use this program and only have the access runtimes, although the file DSN is identical on all of their computers. if i save the password, will it work for them also?
 
ok, i've tried this and it did not work. it's still like the query is just not being run and there's no error message of any kind.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top