Protecting program hard number

shamal

Registered User.
Local time
Today, 01:40
Joined
Sep 28, 2013
Messages
86
Hi
How can Protecting program hard number?
Please.
 
I don't understand your question, please supply more information!
 
Hey shamal, still doesn't make sense, sorry. :(
 
do you need to know the serial number of harddisk?
 
still cannot get a clue, i think we should call batman, mr.riddler.
 
shamal,
Why not write a description of what you mean in your own language, then use Google translate to get the English equivalent? Readers do not understand your post, and repeating it doesn't help.
 
Hi
I want to protect the hard disk Accesse number database
another meaning
Can not open database does not if you enter Hard Disk No.
 
???? As others have said, your post makes no sense????

retyping your post doesn't help.

????database if you enter not open does not if you enter can Hard Disk No????
 
I think he's already using a translator and whatever the phrase is he's plugging into it, he keeps getting the same gibberish phrase back out.

shamal, try a different translator.
 
HI i sorry
I mean that is how you can protect the database Accesse when you give it to the customer
The best way to protect the database
The best solution to protect the database so that it can not be sold to more than one person
 
simply create a "custom" property on the database and compare that value when the db is started, maybe on autoexec macro. you are right all the way we can use the serial number of harddisk as a property.

put this in a module and call this on autoexec macro:
macro: RunCode: GetSetHardDiskSerial()
Code:
Public Function GetSetHardDiskSerial()
    Dim prop As DAO.Property
    Dim dbs As DAO.Database
    On Error GoTo Err_Handler
    Dim strHarddisk As String
    Set dbs = CurrentDb
    'Set the property's value
    'If it doesn't exist, an error 3270 "Property not found" will occur
    strHarddisk = dbs.Containers("Databases")("UserDefined").Properties("HardDisk").Value
    If Err.Number = 0 Then
        If strHarddisk <> GetPhysicalSerial()(1) & "" Then
            MsgBox "You have been a victim of counterfeit!"
            Application.Quit
        End If
    End If
    Set prop = Nothing
    Set dbs = Nothing
    Exit Function
    
Err_Handler:
    If Err = 3270 Then
        'If the property doesn't exist, create it
        Set prop = dbs.CreateProperty("HardDisk", dbText, GetPhysicalSerial()(1) & "")
        'Append it to the collection
        dbs.Containers("Databases")("UserDefined").Properties.Append prop
    End If
    Resume Next
End Function


Function GetPhysicalSerial() As Variant

Dim obj As Object
Dim WMI As Object
Dim SNList() As String, i As Long, Count As Long

Set WMI = GetObject("WinMgmts:")

For Each obj In WMI.InstancesOf("Win32_PhysicalMedia")
If obj.SerialNumber <> "" Then Count = Count + 1
Next

'ReDim SNList(1 To Count, 1 To 1)
ReDim SNList(1 To Count)

i = 1
For Each obj In WMI.InstancesOf("Win32_PhysicalMedia")
 'SNList(i, 1) = obj.SerialNumber
 SNList(i) = obj.SerialNumber
i = i + 1
If i > Count Then Exit For
Next

GetPhysicalSerial = SNList
End Function
 
simply create a "custom" property on the database and compare that value when the db is started, maybe on autoexec macro. you are right all the way we can use the serial number of harddisk as a property.

put this in a module and call this on autoexec macro:
macro: RunCode: GetSetHardDiskSerial()
Code:
Public Function GetSetHardDiskSerial()
    Dim prop As DAO.Property
    Dim dbs As DAO.Database
    On Error GoTo Err_Handler
    Dim strHarddisk As String
    Set dbs = CurrentDb
    'Set the property's value
    'If it doesn't exist, an error 3270 "Property not found" will occur
    strHarddisk = dbs.Containers("Databases")("UserDefined").Properties("HardDisk").Value
    If Err.Number = 0 Then
        If strHarddisk <> GetPhysicalSerial()(1) & "" Then
            MsgBox "You have been a victim of counterfeit!"
            Application.Quit
        End If
    End If
    Set prop = Nothing
    Set dbs = Nothing
    Exit Function
    
Err_Handler:
    If Err = 3270 Then
        'If the property doesn't exist, create it
        Set prop = dbs.CreateProperty("HardDisk", dbText, GetPhysicalSerial()(1) & "")
        'Append it to the collection
        dbs.Containers("Databases")("UserDefined").Properties.Append prop
    End If
    Resume Next
End Function


Function GetPhysicalSerial() As Variant

Dim obj As Object
Dim WMI As Object
Dim SNList() As String, i As Long, Count As Long

Set WMI = GetObject("WinMgmts:")

For Each obj In WMI.InstancesOf("Win32_PhysicalMedia")
If obj.SerialNumber <> "" Then Count = Count + 1
Next

'ReDim SNList(1 To Count, 1 To 1)
ReDim SNList(1 To Count)

i = 1
For Each obj In WMI.InstancesOf("Win32_PhysicalMedia")
 'SNList(i, 1) = obj.SerialNumber
 SNList(i) = obj.SerialNumber
i = i + 1
If i > Count Then Exit For
Next

GetPhysicalSerial = SNList
End Function

You can give an example for the purpose of the application please
 
shamal,

You asked the question
..how you can protect the database Accesse when you give it to the customer
The best way to protect the database
The best solution to protect the database so that it can not be sold to more than one person


and arnelgp answered you directly.

What part do you not understand?

If we have still misunderstood your question, then I think you will have to do some research or post a few examples to clarify things.

I think arnelgp has given you the answer.
 
shamal,

You asked the question
..how you can protect the database Accesse when you give it to the customer
The best way to protect the database
The best solution to protect the database so that it can not be sold to more than one person


and arnelgp answered you directly.



What part do you not understand?

If we have still misunderstood your question, then I think you will have to do some research or post a few examples to clarify things.

I think arnelgp has given you the answer.

Sorry my brother, but my knowledge of dealing with the few codes Visual
 
for sample sake, run the db first time on your pc. copy the db and run it in another pc.
 

Attachments

Users who are viewing this thread

Back
Top Bottom