Consulting

Results 1 to 7 of 7

Thread: Solved: Access Run-Time limitations/capabilities

  1. #1
    VBAX Regular n8Mills's Avatar
    Joined
    Sep 2006
    Location
    Washington State
    Posts
    54
    Location

    Solved: Access Run-Time limitations/capabilities

    Hello, All!

    I've been trying to solve some corporate problems at work via Access, and have met with certain successes, but I have also encountered the licensing obstacle, which dictates that for every machine that I would like to incorporate Access in, we need to buy a license for.

    So, if there are ways I can "trim back" the need for full versions of Access, it's desireable where possible. So, I need to define what the Run-Time can & can't do. Incidentally, can it:
    • Append a table?
    • Open Excel, Word or Outlook?
    • Print Access Reports?
    I read that the Run-Time can't use the DoCmd which I am currently using in the following sub to append a Table:

    Private Sub SRU_Exchange_Form_Click()
        
        Dim strSQL As String
    
        strSQL = "INSERT INTO tblSRUfromRepTech (Notif, SO, Requesting Tech, SRU PN, SRU SN, SRU Mods, SRU Ref Deg, PN Requested, Alternate PN) VALUES ('" & Form_SRURepairExchange.txtNotifSRU & "', '" & Form_SRURepairExchange.txtSOSRU & "', '" & Form_SRURepairExchange.cmbTech & "', '" & Form_SRURepairExchange.txtSRUPN & "', '" & Form_SRURepairExchange.txtSRUSN & "', '" & Form_SRURepairExchange.txtSRUMods & "', '" & Form_SRURepairExchange.txtRefDeg & "', '" & Form_SRURepairExchange.txtReqPN & "', '" & Form_SRURepairExchange.txtAltPN & "');"
       
        DoCmd.SetWarnings False
        DoCmd.RunSQL strSQL
        DoCmd.SetWarnings True
    
    End Sub
    Really, the need to append tables and send emails is paramount. If I have to use the full version, so be it, but a workaround is desired as there are a significant amount of computers that would need to not only be able to access the data, but contribute to the database and print documents from it as well.

    Any big-brain help is welcome!

    Many thanks,

    Nate

  2. #2
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    You can perform most of the tasks you mentioned with MDAC w/out having to install or license Access on workstations (which assumes some central place where Access is installed and licensed is used to create template files with VBA code.

    This means, however, you must use ADO and Jet 4.0, not DAO, and you will need a host for script code, viz. WSC, VBScript or a scripting language with an OLE interface.

    .02 Stan

  3. #3
    VBAX Regular n8Mills's Avatar
    Joined
    Sep 2006
    Location
    Washington State
    Posts
    54
    Location
    stanl,

    Thanks for responding so quickly! Also, thanks for the guidance. I guess this means I have some research to do concerning ADO vs DAO (I've seen the acronyms floating around but until now they seemed unimportant.

    Maybe an easy next question to answer is: If I build the User Form with script in it, or if I host the script in a module, can the runtime use that? I'm not sure what you mean by "you will need a host for script code". (n00b alert!)

    Thanks & best regards,

    Nate

  4. #4
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    If you are just concerned with a runtime application, then forms is the only way to go - see

    http://support.microsoft.com/kb/842004

    I was more or less describing a situation where a runtime was not even used, but you still wanted users to manipulate data in Access Tables which is why I mentioned MDAC.

    Stan

  5. #5
    VBAX Regular n8Mills's Avatar
    Joined
    Sep 2006
    Location
    Washington State
    Posts
    54
    Location

    Append Table from User Form

    I've set up a pretty comprehensive system for our needs, but so far it's all been hinging on the use of "DoCmd", which the run-time does not support. This is a shame because it's so code-simple. None of MS's "Append Table" help references forms, they're all based on other tables.

    So, the big question: How can I take this code

    Dim strSQL As String
     
        strSQL = "INSERT INTO tblSRUfromRepTech (Notif, SO, Customer) VALUES " _
        & " ('" & Form_SRURepairExchange.txtNotifLRU & "' , '"Form_SRURepairExchange.txtSOLRU & "', '" & Form_SRURepairExchange.txtLRUCust & "', " .cmbReqPN & "', '" & Form_SRURepairExchange.cmbAltPN & "';"
     
    DoCmd.SetWarnings False
    DoCmd.RunSQL strSQL
    DoCmd.SetWarnings True
    And use it with the run-time?

  6. #6
    VBAX Regular n8Mills's Avatar
    Joined
    Sep 2006
    Location
    Washington State
    Posts
    54
    Location
    Partial success! Use this:

        CurrentDb.Execute strSQL
    Only some of the items don't append as values, they populate the database as they are literally entered. I'll figure it out, no doubt it's due to the " or ' or whatever.

  7. #7
    VBAX Regular n8Mills's Avatar
    Joined
    Sep 2006
    Location
    Washington State
    Posts
    54
    Location
    And don't forget to dim the database:
     
    Dim CurrentDb as Database
    Dim strSQL As String
     
        strSQL = "INSERT INTO tblSRUfromRepTech (Notif, SO, Customer) VALUES " _
        & " ('" & Form_SRURepairExchange.txtNotifLRU & "' , " & " _
        & " '"Form_SRURepairExchange.txtSOLRU & "', '" & " _
        & " Form_SRURepairExchange.txtLRUCust & "', " .cmbReqPN & "', '" & " _
        & " Form_SRURepairExchange.cmbAltPN & "';"
     
    CurrentDb.Execute strSQL
    I'm so glad this worked out. If anybody considers code daunting, hang in there, it really starts making sense after a bit of thinking. Plus, the search engines are your friends! Rephrase often, search new forums. Some are good, others are hopeless jumbles of data.

    This above code works in my run-time environment. I am still debugging but it works! Run-time friendly code is a huge win for large companies, because it is free to install on as many machines as you want.

    Stan, thanks for your guidance, I just needed that helpful push.

    Kind regards,

    n8

Posting Permissions

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