Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 25th, 2004, 06:19 PM
Authorized User
 
Join Date: Aug 2004
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default Data Access Page

Hello All,
In Access 2002 Desktop Development by Alison Balter it says that when you save a form as a data access page that you can't modify data in the page. It would be convenient for me to be able to save several of my forms as data access pages and be able to modify the data using the form. For example, one of my forms is used to delete printers and when you click the delete button VBA code runs in the background that runs an append query that appends the data to a target table then deletes the data from the source table. I have several forms that run similar to this. I guess my question is: Is it possible to create a form with a command button powered by VBA, save it as a data access page and be able to have the data access page work the exact same way as the form?

 
Old October 25th, 2004, 06:34 PM
Authorized User
 
Join Date: Oct 2004
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Allison is correct. You usually cannot edit data in a Data Access Page that you export from a form -- but you often can tweak the DAP properties to make it updatable. Sometimes all it takes is setting the Allow Edits property or the Unique Table property.

As for your specific case where you want to execute VB code in a DAP -- you can't do that. You'll find that Access exports your VB code as comments. If you understand VBScript, you can usually rewrite your code to perform the same function.


John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
 
Old October 26th, 2004, 04:32 PM
Authorized User
 
Join Date: Aug 2004
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your help. I am impressed with your repertoire.
You must know your stuff to write that many books. I have a
question about VBScript. I bought a book on VBScript for
beginners. Do you think this is a good language to use for
performing tasks similarly to VBA? I would really love to be
able to make this Data Access Page do exactly what my Access
form does. If I save my Access form as a Data Access Page,
will I be able to make the command button run an append query
and a delete query using VBScript?


 
Old October 26th, 2004, 07:23 PM
Authorized User
 
Join Date: Oct 2004
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

VBScript is a subset of Visual Basic. If you understand VBA well, then you don't need a book on VBScript. You can find everything you need to know at:

http://msdn.microsoft.com/library/de...rivbscript.asp

And yes, you can write VBScript to make a DAP do a lot of things you would do in VBA.


John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
 
Old October 29th, 2004, 03:43 PM
Authorized User
 
Join Date: Aug 2004
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am getting a lot of error prompts asking me if I trust my website and that my provider may be unsafe. Is there a way to make this stop? Better yet, I can't seem to find any valuable information in my Alison Balter book about Data Access Pages. Can anyone recommend a good book that will discuss mainly Data Access Page development? I need to find a way to get the most use out of Data Access Pages, what the error messages mean and how to stop them and how to tweak the data access pages to do what I want. This isn't as hard as it looks right? These Jet Engine errors could cause some problems if the user this database is intended for sees them.

 
Old October 29th, 2004, 07:05 PM
Authorized User
 
Join Date: Oct 2004
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Open Internet Explorer. Choose Internet Options from the Tools menu. On the Security tab, click the Custom Level button. Under Miscellaneous options, Set Access Data Sources Across Domains to Yes.

I know of no book that just discusses Data Access Pages. I have an entire chapter on the subject in both my Running and Inside Out books.




John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
 
Old November 1st, 2004, 08:15 PM
Authorized User
 
Join Date: Aug 2004
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here's another one. I have the following criteria being used for a parameter query(which is the data source for my data access page): Like [What IP Address Would You Like To View?] & "*". When I open my data access page it prompts me for my selection but it won't acknowledge the fact that I have an asterisk in the criteria. This means that I cannot type in 163 and have the data access page show me all IP addresses that start with 163. The query itself will do what I want but the DAP will not. Any suggestions?

 
Old November 1st, 2004, 08:54 PM
Authorized User
 
Join Date: Oct 2004
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, DAPs run on the ADO model, so you probably need an ANSI wildcard in your LIKE predicate (% instead of *). But I didn't think a parameter query would work at all in a DAP - unless perhaps opened within Access. I'll have to try it in a DAP opened in Internet Explorer - should be interesting.


John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
 
Old November 1st, 2004, 09:50 PM
Authorized User
 
Join Date: Aug 2004
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I cannot change my query to use % instead of *. I will have to create 2 queries. One that uses * and one that uses %, but that would be a royal pain. I will have to do some reading on ADO. Please let me know what you find out with your experiment. Thanks for your help.

 
Old November 1st, 2004, 11:36 PM
Authorized User
 
Join Date: Aug 2004
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I created a new query and changed the * to a %. I then created a new DAP with the new query as the data source and it now allows me to search for IP's using selection criteria. In other words, I can look at all IP's that start with 163 using the Data Access Page. Thanks John for your help. It is much appreciated.






Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Access: Data Access Page sevp95 Access VBA 0 July 14th, 2008 11:07 AM
access data from another page rocksbhavesh ASP.NET 1.0 and 1.1 Professional 5 March 26th, 2007 08:18 AM
Data Access Page Problem please help! jdbash1 Access 0 June 5th, 2006 02:16 PM
Data access page Fntmn Javascript How-To 1 March 21st, 2006 07:15 AM
Data access page access problem :) kev_79 Access 0 September 4th, 2003 04:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.