PDA

View Full Version : Solved: Access Run-Time limitations/capabilities



n8Mills
10-08-2006, 10:33 AM
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

stanl
10-08-2006, 01:35 PM
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

n8Mills
10-08-2006, 08:18 PM
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

stanl
10-09-2006, 02:52 AM
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

n8Mills
10-20-2006, 02:59 PM
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?

n8Mills
10-20-2006, 04:17 PM
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.

n8Mills
10-24-2006, 05:50 PM
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