Lotus Notes SQL - how do you open a "private" view in VB?

  • Hello,

    I need to pull data from a subform which is computed in a lotus notes database.  I know that the Lotus SQL driver is not capable of pulling fields from anything but the top level form or view due to the way Lotus works.  So, I created a "private" view on the PC, but I cannot seem to open it.  The "base" table is titled "table_main".  I can open it, and get a field count with the following code:

    Public Sub my_loop()

    Set conn = CreateObject("ADODB.Connection")

    conn.ConnectionString = "DSN=N_connect"

    conn.Open

    Dim szSQL As String

    Dim fldLoop As Field

    szSQL = "Select * FROM table_main"

    Dim rs As ADODB.Recordset

    Set rs = New ADODB.Recordset

    rs.Open szSQL, conn, , , adCmdText

    rs.MoveFirst

    alltabledefs = rs.Fields.Count

    rs.Close

    ******************************************

    Changng teh SQL statement to my private view, called "view1" the code now looks this way:

    ******************************************

    Public Sub my_loop()

    Set conn = CreateObject("ADODB.Connection")

    conn.ConnectionString = "DSN=N_connect"

    conn.Open

    Dim szSQL As String

    Dim fldLoop As Field

    szSQL = "Select * FROM view1"

    Dim rs As ADODB.Recordset

    Set rs = New ADODB.Recordset

    rs.Open szSQL, conn, , , adCmdText

    rs.MoveFirst

    alltabledefs = rs.Fields.Count

    rs.Close

    *******************************************

    When I try to run this code, I get the SQL error message "base table view1 not found".  What am I doing wrong?  If I need to keep the table_main reference as my base table, how do I specify the private view, view1, that I have created in the SQL line??  Thanks in advance

  • Hmmmm - if this is about SQL Server administration, I'm a chicken tikka massala.

    But I've done some Notes in the past.  When you open the Notes connection, are you connecting as the same user who created the pivate view - if not, I think Notes security will prevent you from accessing it.


  • - thought I might learn something about Lotus N...but find instead that the one SSC member - who, until now, has been considered a dead ringer for a chicken tikka masala has actually been masquerading just to throw us all off the fowl scent...







    **ASCII stupid question, get a stupid ANSI !!!**

  • Sorry if this post was in the wrong section Phil.

    Yes, I am connecting as the same user who created the private view when I get the error message, so I am not sure why I cannot get to the view.  I'm trying to extract data from Lotus by creating a private view, because the data is not accessible under the computed form where it lives, as this is a limitation of NotesSQL.

     

    The documentation about the functions of NotesSQL are so poor I'm not sure where to turn to for help....

  • No problem - though this is a SQL Server place really.

    I have a friend who is a Notes developer - I'll ask him & see whether he's got any ideas.

    Phil


Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply