Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Location
    Sheffield, UK
    Posts
    17

    Angry Unanswered: 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

  2. #2
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    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

  3. #3
    Join Date
    Dec 2003
    Location
    Sheffield, UK
    Posts
    17
    So I am not able to run a macro from an ASP page then?

  4. #4
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •