Solved

NotesSql - VB example to connect and pull info

Posted on 2004-10-07
6
1,753 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
  • 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
ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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