[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Access ASP link from VB 6.0 Desktop App

Posted on 2004-11-01
5
Medium Priority
?
289 Views
Last Modified: 2012-05-05
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
Comment
Question by:cheyennejk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 16

Expert Comment

by:jimbobmcgee
ID: 12462019
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
 
LVL 16

Accepted Solution

by:
jimbobmcgee earned 1000 total points
ID: 12462024
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
 
LVL 2

Author Comment

by:cheyennejk
ID: 12462160
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
 
LVL 16

Expert Comment

by:jimbobmcgee
ID: 12462668
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
 
LVL 2

Author Comment

by:cheyennejk
ID: 12462689
Nevermind my last comment, I got it working.
Thanks!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question