PDA

View Full Version : Vba and Access noobie questions



3z3k3l
09-07-2006, 10:34 AM
1. Our software developer created a software using VBA as a module in Access, We would like to let people use our software for 30 days then disable it until they enter in the right key code.
Is there a way to do this? We currently use a key generator to give them key codes but it only limits the number of records our software imports. I don't know how to give them full access for a time period. Is that possible? If so please share! :)

2. We had another software company tell us they would like to get information from our software using an API but they said we need to migrate our VBA app to VB.Net or something like that so we can create an API. They use Java and netbeans I think.
Is this true, It this the only way? What program do you suggest we migrate it too?

3. Web Version- I want to allow our software to have a web interface as well. Does VBA/Access support this? We have about 800 printed pages of code how difficult would it be to add a web based interface for it?
I am looking to pay someone to do this, so if your intertested please let me know but either way, would someone let me know how much work is invovled, is that a month worth of work or 40 hours or 100 hours. I just don' t know what its worth to pay someone to do it.


Thanks,
3z3k3l

XLGibbs
09-07-2006, 06:13 PM
If you are talking a web based application, asp.net or waiting for the MS Office with .xml compatibility would make things a but easier.

As far as #1, yes it is possible I believe, but would require a bit of work. In general, a module would fire everytime the workbook is opened which would/could require a temporary password to unlock the file. A different password (perhaps the "committed" one that is paid for) would unlock the whole file and execute another macro that effectively erases the original.

Problem is, VBA is particular easy to get around, and it would take a knowledgeable person a matter of minutes to find the actual code.

The best option is a VB program that might use Access as it's back end. There are far more options with respect to security and useability.

Do a search in the KB on this site for "Set a trial period" and you will see an Excel example of such code.

Depending on the end users for the software, development could be any level of hours. The more sophisticated the end result desired, the more expensive it would be.

GaryB
09-08-2006, 08:47 AM
I believe I can help with the trial period. I had the same problem a while back and got this from this forum. I wish I could remember who sent it to tme but here it is.

Module 1
Public Function StartUp()
ExpiryDate
'no return value but must be a function for macro to be able to call it
'call this from autoexec macro
On Error Resume Next
If Now >= DBEngine(0)(0).Properties("ExpiryDate") Then
MsgBox "This application has expired. @Please contact ?????????? @to obtain a new version."
Application.Quit
Else
If Err = 3270 Then Exit Function 'property does not exist
End If
End Function

module 2
Sub ExpiryDate()
'creates or resets a property called ExpiryDate
'to use it type ExpiryDate in the debug window
'to remove the property type the following in the debug window
' DBEngine(0)(0).Properties.Delete "ExpiryDate"
On Error Resume Next
Dim db As Database
Dim p As Property
Dim pval As Date
Set db = DBEngine(0)(0)
'get the required expiry date (defaults to 30 days from now)
'NOTE: if an invalid date is entered it will generate 00:00:00
pval = CDate(InputBox("Enter the Expiry Date", "Set Expiry Date", Now() + 30))
With db
'check to see if already defined
Set p = .Properties("ExpiryDate")
If Err = 3270 Then 'property does not exist
Set p = .CreateProperty()
p.Name = "ExpiryDate"
p.Type = dbDate
p.Value = pval
.Properties.Append p
Debug.Print "Expiry Date is : "; p.Value
GoTo exit_setexpirydate
Else
Debug.Print "Expiry Date was : "; p.Value
p = pval
Debug.Print "Expiry Date is now : "; p.Value
End If
End With
exit_setexpirydate:
Set p = Nothing
Set db = Nothing
End Sub

Fill in what you want your message to read when it expires and this should help.

Gary

Imdabaum
09-15-2006, 01:12 PM
The best option is a VB program that might use Access as it's back end. There are far more options with respect to security and useability.



So if you already have the forms in VB how hard would it be to build a VB.Net or Visual Studio.Net application based on the forms. I know it is easy to tie access on to the backend of Visual Studio. But I'm thinking it would involve recoding everything because the syntax is slightly different from VB to .Net.