• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 292
  • Last Modified:

Access ASP link from VB 6.0 Desktop App

I am not a VB developer and I need help to integrate an ASP web application with a VB 6.0 desktop. application.  This may be an easy question but I have no idea how to do this. PLEASE HELP!!!

I want users to be able to click on a button in the VB application that will open a web form provided by an ASP 3.0 application. Security information needs to be passed to the ASP page to determine permissions for the appropriate user.
0
cheyennejk
Asked:
cheyennejk
  • 3
  • 2
1 Solution
 
jimbobmcgeeCommented:
If your security details are passed to the ASP app with the querystring (the bit in the web address after a ?), you could compile an address string from the app homepage and your user details and use the ShellExecute API to open it...

    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
                    (ByVal hwnd As Long, ByVal lpOperation As String, _
                     ByVal lpFile As String, ByVal lpParameters As String, _
                     ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
                                                'DECLARE API FUNCTION
   
   
    Private Sub CommandButton1_Click()
   
        strUserName = "thisUser01"              'THE USERNAME -- USE YOUR METHOD
        strPassword = "thisPassword01"          'THE PASSWORD -- USE YOUR METHOD
        strASPApp = "http://www.myaspapp.asp"   'THE APP START PAGE
       
        strShellAddress = strASPApp & "?user=" & strUserName & "&pass=" & strPassword
                                                'COMPILE QUERY STRING FROM DATA/FORMAT
       
        ShellExecute Application.hwnd, "", strShellAddress, "", "", 1
                                                'OPEN BROWSER PAGE
       
    End Sub

Otherwise, if you want to keep the browser within the Application, you can use a browser control, with similar effect...

HTH

J.
0
 
jimbobmcgeeCommented:
You may have to change

     ShellExecute Application.hwnd, "", strShellAddress, "", "", 1

to

     ShellExecute Me.hwnd, "", strShellAddress, "", "", 1

if it throws up an error on this line...

J.
0
 
cheyennejkAuthor Commented:
Im afraid that being new to VB, Im a little slow.

Suppose I have a single form with a single button. Where do i declare the API function?
0
 
jimbobmcgeeCommented:
API declaration would go in the General/Declarations section of the form or, if that doesn't work, inside its own module.  If it does need to go in its own module, you will need to change Private Declare to Public Declare...

J.
0
 
cheyennejkAuthor Commented:
Nevermind my last comment, I got it working.
Thanks!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now