?
Solved

NotesSql - VB example to connect and pull info

Posted on 2004-10-07
6
Medium Priority
?
1,763 Views
Last Modified: 2013-12-18
Just downloaded the NotesSql software from IBM.  Said it had programming examples, but coming up short.  I need a simple basic example of how to connect and iterate through the notes names.nsf database using Visual Basic 6.0.  I have written numerous accesses to DB2 and other facitlities, but cannot get the connect string to work.  
0
Comment
Question by:TheVeee
[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
  • 4
  • 2
6 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12249302
First did you configure DSN for Notes db using ODBC ?

And test the connections ?

~Hemanth
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12249309
Scripting is something similar to what you do for any regular dbms...
0
 
LVL 5

Author Comment

by:TheVeee
ID: 12250512
Yes configured the dsn and it found my Notes database.  Then drop down box was populated with necessary nsf.  Picked the names.nsf and everything seemed ok.  Have provided my snippet of code for connect....

Since posting, have got to connect, but get message base table not found - names... message
Names is the standard names.nsf everyone uses.  Additionally pointed to this in my DSN so dont understand why
it didnt find it

    ' Connect to a Database
    Set conn = CreateObject("ADODB.Connection")

'   conn.ConnectionString = "DSN=Notes1"
    conn.Open
   
    Dim szSQL As String
    szSQL = "Select LastName FROM names"
    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    rs.Open szSQL, conn, , , adCmdText   <------------- Failing here.....
    iEmpID = rs.Fields.Item(0).Value
    rs.Close
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12251052
This statement is wrong...

> szSQL = "Select LastName FROM names"

You should specify a view here instead of names..eg;

 szSQL = "Select LastName FROM People"    ... This will extract field name "LastName" from the view "People"


For more details look into the notes sql help file
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 1000 total points
ID: 12251080
First you have to understand the components of the notes vs dbms...

Table        FormViewFolder            
SQL Tables map to either Notes forms or Notes views.  

Column      Form FieldView Column  
When creating a NotesSQL Table or View, avoid using column names that are ODBC or SQL reserved words or that contain characters other than letters, numbers, or underscores.  

Index          View  
A SQL Index maps to a Notes view in which all sorted columns refer directly to fields in a single form, and which selects documents from only that form.  

View          ViewFolder  
A SQL View maps to a Notes view that selects documents from one form, in which all columns are calculable from the form.When you create a view using SQL, a view is created in Notes that selects from one form. Except for private views, all Notes views are reported as SQL views.  
0
 
LVL 5

Author Comment

by:TheVeee
ID: 12251417
Once I got that principle, I was in like Flint!!  Worked awesome and its actually pretty darn easy!! Thanks for the help
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.

Question has a verified solution.

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

This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

762 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