Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setPassWord and PassKey - How to

Status
Not open for further replies.

StephenNapper

Technical User
Mar 27, 2006
6
GB
Dear Forum,

I have written the following code to run an external program so that Excel can query it's database. As a 'Developer' I am to set the Password, PassKey and apply a Permit. The words make some form of sense and I feel frustratingly close but need a little help to get over the line.

Sub StartBreve()
Dim Program As String
Dim TaskID As Double
On Error Resume Next
Program = "C:\Program Files (x86)\Tekla\BREVe\32\BREVe32.exe. "
setPassword = "888888"
PassKey = "********"
TaskID = Shell(Program, 1)
If Err <> 0 Then
MsgBox "Cannot Start " & Programs, vbCritical, "Error"
End If
End Sub

I have replaced the Password and Passkey for the sake of the post, BUT as you can guess the real ones aren't working.

The guidance I have from my vendor is:

PASSWORD, PASSKEY AND PERMIT
Developers will be provided with three keys which enable the application to run on any PC without the need to register BREVe for general use. The Developer is responsible for providing any necessary access restrictions in the application itself. The three keys are all 32-bit signed integers, but may be entered as the equivalent hexadecimal values (usually by prefixing the hexadecimal code with the symbol $).
• The PassWord and Permit values are used in a call to setPassWord (which returns TRUE if successful and also sets the Developer property to TRUE). The PassWord is unique to the Developer. The Permit value exists to prevent non-developers from setting the PassWord.
• The PassKey value is set as a property (e.g. by B32X1.PassKey:=$A1B2C3D4 in hexadecimal form).
• Having set these values, call the Authorize method.

But frankly it's not helping. I'm hoping that you can.....
 
This isn't really a VB issue, I'm afraid. It's a Tekla issue. Does Tekla not have a support line?

A brief bit of help

1) You need to be using the ActiveX control for this. The BREVe application itself is not automatable. The control can be found as (by default) [tt]C:\program files\csc\breve\32\BVe32XControl2.ocx[/tt]
2) The ActiveX control is reasonably well-documented in the BREVe help file that ships with the application
3) Drop a copy of the control onto a form
4) Add code similar to the following, perhaps in the Form's load event (basically you want to run this code before any further access to the control)

Code:
[blue]PPrivate Sub Form_Load()
    If BVe32X1.setPassword(&H4039E1D3, &H12345678) Then [green]' examples of Password and Permit for VB. BREVe help file examples assume Borland Object Pascal[/green]
        Debug.Print "setPassword worked"
        BVe32X1.Passkey = &H87654321
        BVe32X1.authorize
    End If
    
    Debug.Print BVe32X1.Passkey
End Sub[/blue]

Beyond that I can't help much. I'm not a BREVe user.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top