Solved

NotesSql - VB example to connect and pull info

Posted on 2004-10-07
6
1,747 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now