Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Running an Access Macro from an ASP Page

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-10-03, 07:55
Wheelz Wheelz is offline
Registered User
 
Join Date: Dec 2003
Location: Sheffield, UK
Posts: 17
Angry Running an Access Macro from an ASP Page

Hi All,

I have an Access Database which is used to create quotations from data which is fed into it from a series of ASP Pages. Getting the infomation in is no problem. But then it created the quote in DOC format and mails a copy to the client and a copy to the company. The problem I have is that I can't get the mail merge macro to run from ASP. What I want is for the user to click a button on the page, then for the page to call and run the Access Macro. The code I have put in is below:

Dbpath = "\_wibble\ledburynet.mdb"
Set objAccess = Server.CreateObject("Access.Application")
objAccess.Visible = False
objAccess.OpenCurrentDatabase "F:\websites\ledburyremovalsltd.co.uk\_wibble\Ledb urynet.mdb"
Set objDb = objAccess.CurrentDb()
macroname = "mcroMailMerge"
objDb.DoCmd.RunMacro macroname
set objDb = nothing
objAccess.Quit acQuitSaveNone
Set objAccess = nothing
Reply With Quote
  #2 (permalink)  
Old 12-10-03, 09:06
Bullschmidt Bullschmidt is offline
Guru
 
Join Date: Jun 2003
Location: USA
Posts: 1,024
ASP pages can "see" Access tables (and queries) through the connectioin but not the other Access objects.
__________________
J. Paul Schmidt, Freelance Web and Database Developer
www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
Reply With Quote
  #3 (permalink)  
Old 12-10-03, 11:33
Wheelz Wheelz is offline
Registered User
 
Join Date: Dec 2003
Location: Sheffield, UK
Posts: 17
So I am not able to run a macro from an ASP page then?
Reply With Quote
  #4 (permalink)  
Old 12-10-03, 14:41
Bullschmidt Bullschmidt is offline
Guru
 
Join Date: Jun 2003
Location: USA
Posts: 1,024
That is correct. And here is a little something I put together about what ASP pages CAN do.

You and others can have access to a database hosted on the Web from any location that has a browser with an Internet connection.

The Web database concept makes sense if you and your people want to do work in various locations in or outside the office and still be "plugged" in.

For example you could have employees enter timesheets or have sales reps log their contacts. Or perhaps you'd like customers to be able to check the status of their orders online without having to call the company.

If you want a Web database, typically what would happen is that a database such as Access or MySQL (basically just consisting of tables) would be put on the Web.

Then "dynamic" Web pages (actually ASP pages which include VBScript, HTML, and/or JavaScript) would be created acting like the old desktop database's queries, forms, and reports to access the database - all hosted on a Web Server.

Dynamic Web pages are similar in many ways to regular HTML pages. But they are "live" because the user can read from and write to information in the database. An example where you can login and add, edit, or view fictional customers and invoices is at http://www.bullschmidt.com/login.asp

Not all Web hosts will handle dynamic Web pages but many do. The Web hosts that can handle ASP pages usually have a Windows 2000 operating system running an IIS Web server.

Here are a few good ASP sites:
o ASP101 Samples - http://www.asp101.com/samples
o W3Schools ASP Tutorial - http://www.w3schools.com/asp
o Microsoft VBScript Language Reference - http://msdn.microsoft.com/scripting/...bscripttoc.htm

And the following newsgroup is good:
microsoft.public.inetserver.asp.general

Or for a "quick and dirty" generic ASP open source solution to putting databases on the Web that just requires setting up a configuration page for each table or query and uploading the database to the Web as long as there is an autonumber field in each table (and you'll probably also separately want to create login capabilities), perhaps try something like this:
GenericDB by Eli Robillard
http://www.genericdb.com and then click on the Tips link to see an example
__________________
J. Paul Schmidt, Freelance Web and Database Developer
www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On