Solved

NotesSql - VB example to connect and pull info

Posted on 2004-10-07
6
1,759 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 250 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

726 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