|
Subject:
|
Data Access Page
|
|
Posted By:
|
Teqlump
|
Post Date:
|
10/25/2004 6:19:23 PM
|
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?
|
|
Reply By:
|
JLovell
|
Reply Date:
|
10/25/2004 6:34:09 PM
|
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"
|
|
Reply By:
|
Teqlump
|
Reply Date:
|
10/26/2004 4:32:31 PM
|
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?
|
|
Reply By:
|
JLovell
|
Reply Date:
|
10/26/2004 7:23:37 PM
|
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/default.asp?url=/library/en-us/script56/html/vtorivbscript.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"
|
|
Reply By:
|
Teqlump
|
Reply Date:
|
10/29/2004 3:43:46 PM
|
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.
|
|
Reply By:
|
JLovell
|
Reply Date:
|
10/29/2004 7:05:48 PM
|
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"
|
|
Reply By:
|
Teqlump
|
Reply Date:
|
11/1/2004 7:15:29 PM
|
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?
|
|
Reply By:
|
JLovell
|
Reply Date:
|
11/1/2004 7:54:46 PM
|
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"
|
|
Reply By:
|
Teqlump
|
Reply Date:
|
11/1/2004 8:50:31 PM
|
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.
|
|
Reply By:
|
Teqlump
|
Reply Date:
|
11/1/2004 10:36:12 PM
|
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.
|