Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480

    Frames issue with IE

    Alright, so here is the scanrio.. I am trying to automate login and navigation to a specific site... The site is devided into two frames.. the one on the left, is named left and the one on the right is named right.



    SO.... here is the top of the code, shows you the frame names

    Code:
    <head>
    <frameset cols="22%,78%">
         <frame name="left" src="http://xxx.xxx.xxx.xxx/cgi/xxx_tool_v1-6.cgi/left">
         <frame name="right" src="http://xxx.xxx.xxx.xxx/cgi/xxx_tool_v1-6.cgi/right">
    I am able to launch the website "http://thisisthesite.net" and within this site the two frames reside. Normally I would just use the code below to send in credentials....

    Neon.Document.all.Item("name").Value = User

    But because of the frames, I have to make the code more specific as to WHERE the "name" element is.... I have tried..
    Code:
    Neon.Document.frames("left").Item("name").Value = User
    Neon.Document.frames(0).Item("name").Value = User
    Neon.Document.frames(1).Item("name").Value = User
    BTW, Neon has been dimmed as IE.

    Basically, does anyone have any ideas how I could do this?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    A frame can have a value?

    I use this to pass userID/password to web page:
    oBrowser.Document.all.Item("subAcctLoginName").Val ue = "user"
    oBrowser.Document.all.Item("subAcctPassword").Valu e = "passsword"
    oBrowser.Document.all.Item("Submit").Click

    Maybe the .all will work for you in place of the .frame(x)
    Neon.Document.all.Item("left").Value = User
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Yea, that's what I usually do too. After reading a bit, I have learned to consider "frames" as their own independent webpages... I am going to try some elaborate configurations here, its either going to work or create a black hole of failure.

  4. #4
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Alright, I was finally able to do text input into the boxes...

    Code:
    WfC.Document.frames(0).Document.all.Item("username").Value = User
    
    
    WfC.Document.frames(0).Document.all.Item("password").Value = Pass
    So the text input is working... Now I am trying to do something completely different..

    You see User and Pass, well those are pulled off a linked table, if 'Neon Impact' is not available, it raises error 94. I would like the error handler to build that row or column on this table and have the the chrWebTools= Neon Impact

    Code:
    Sub ImpactNeon()
    
    
    Dim neon As InternetExplorer
    Dim Left, Right As InternetExplorer
    Dim User, Pass As String
    
    
    On Error GoTo Buildrow
    
    
    User = DLookup("[chrWebuser]", "tblWebCreds", "chrWebTools='Neon Impact'")
    Pass = DLookup("[chrWebpass]", "tblWebCreds", "chrWebTools='Neon Impact'")
    
    
    Set neon = Login("Websitehere", True)
    
    
    Call SleepIE(neon)
    
    
    neon.Document.frames(0).Document.all.Item("name").Value = User
    neon.Document.frames(0).Document.all.Item("password").Value = Pass
    
    
    PauseApp 2
    
    
    neon.Document.frames(0).Document.all.Item("button-Login").Click
    
    
    Buildrow:
    If Err.Number = 94 Then
       MsgBox "got the error"
       This is where I can have the code create that row to the table.... then I can do a quick message and 
    have that table open so they can enter their creds for future use. 
    End If
    
    
    End Sub

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Now I remember you! It was from you I got the code in my previous post. Did I ever thank you?

    I don't understand why you have literal string 'Neon Impact' in the DLookup. Shouldn't this be a concatenated variable for the user?

    However, suggest opening form instead of table for the data entry. This part is simple. Open form to new record.
    DoCmd.OpenForm "form name", , , , acFormAdd
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    HAHA, yes you thanked me!

    Well, the table is a list of applications the users access...

    this table has 3 columns at the top.

    Code:
    DLookup("[chrWebpass]", "tblWebCreds", "chrWebTools='Neon Impact'")
    The first column is chrWebTools, and this is where we put the application, name... then the two columns next to it the users manually enter their username and password. The table is linked, but as far as the user knows it looks like a form... DONT GIVE THEM TABLE ACCESS...

    I am really doing a bad job of explaining this. I can host a cisco webex thing if your interested at taking a look.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Each user has their own userID and password to access the website 'Neon Impact'? The DLookup as structured will simply retrieve the first chrWebuser and chrPassword encountered in the table, not the specific values for the current user. Need a variable for that. Either user enters an ID into a textbox and you grab that as the variable or you can have the code pull user's network login id with Environ("USERNAME") (yes, type exactly as shown). Will need field in table to store id. Then the code:

    User = DLookup("chrWebuser", "tblWebCreds", "chrWebTools='Neon Impact' AND ID='" & Me.tbxID & "'")

    If you want network login id:

    User = DLookup("chrWebuser", "tblWebCreds", "chrWebTools='Neon Impact' AND ID='" & Environ("USERNAME") &"'")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Hmm, check private messages

  9. #9
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Probably should have included this bit of info..


    User = DLookup("[chrWebuser]", "tblWebCreds", "chrWebTools='Neon Impact'")
    Pass = DLookup("[chrWebpass]", "tblWebCreds", "chrWebTools='Neon Impact'")

  10. #10
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    And that stuff is working, the part I am trying to do is add a row for Neon Impact on error

    Right now,

    User = DLookup("[chrWebuser]", "tblWebCreds", "chrWebTools='Neon Impact'")

    Pass = DLookup("[chrWebpass]", "tblWebCreds", "chrWebTools='Neon Impact'")

    User and Pass can't be set because 'Neon Impact' is not listed So when they try to run the script, it will give an error .94 so I am trying to make the error handler handle the missing Neon Impact row by simply adding it to the table. then after that its simply...

    MsgBox "Username or Password is missing", , "MY MESSAGE"
    DoCmd.OpenForm "frmWebCreds"





  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    What I don't understand: should each individual have their own ID and password for 'Neon Impact' or does everyone use the same ID and password for 'Neon Impact'? The latter is my situation. We have an office account for a web service. Everyone logs in with the same account ID and password, then the site asks for specific user info the first time they access the account. My code logs users into the account, after that they are on their own.

    I would write code to prevent the error.

    User = Nz(DLookup("[chrWebuser]", "tblWebCreds", "chrWebTools='Neon Impact'"),"")
    Pass = Nz(DLookup("[chrWebpass]", "tblWebCreds", "chrWebTools='Neon Impact'"),"")

    If User = "" Or Pass = "" Then
    'record does not exist
    'open form to enter data
    Else
    'open website
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #12
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Well they each have their own set of credentials. And I am expecting the error to happen the first time they try to run this script, because the 'Neon Impact' does not exists I am wanting the error handler to create a new row, and under the chrWebTools column i want it to be filled in with 'Neon Impact'... THEN as the user uses the script, the error will not occour because the Row for Neon Impact will be available.

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    My point is, if a record exists for Neon Impact for ANY user it will retrieve data even if the current user does not have a record. It just looks for ANY record with 'Neon Impact' and returns value for the first record it hits that meets that condition. Your DLookup is not specific for the current user.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  14. #14
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Ohh okay, now I am starting to understand. From the top lol

    When a user downloads the front end, it is under C:/Program files AND another database called Credentials is stored here
    Environ("userprofile") & "\My Documents\Lift\Credentials.mdb", acTable, "tblWebCreds", "tblWebCreds"
    the Credentials database is blank, except the chrWebTools column, this is prefilled. The user then fills out their own unique Usernames and passwords, and its saved accordingly. So currently we have 90 people using this setup.

    When it was dispatched, there was no need for a 'Neon Impact' row, because we were not interacting with it.. Well now, we are planning on building it into the program... So I need a new row in that table to account for these credentials.

    I could just wipe everyones credentials away, by forcing a new copy of the credentials table to be downloaded. But this would cause downtime that management would not appreciate. So my alternate thought was to use Error handling to have the row built.

  15. #15
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Want to apologize for not fully understanding... It has been one monster of a week.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Tab Issue
    By Lazor78 in forum Forms
    Replies: 3
    Last Post: 07-05-2012, 08:18 AM
  2. End if issue
    By raytackettsells in forum Programming
    Replies: 4
    Last Post: 03-22-2012, 10:21 AM
  3. VBA issue
    By manic in forum Programming
    Replies: 4
    Last Post: 02-28-2012, 03:57 PM
  4. IIF issue
    By mohiahmed in forum Queries
    Replies: 9
    Last Post: 01-22-2012, 01:06 AM
  5. Replies: 1
    Last Post: 10-31-2010, 12:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums