[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

NotesSql - VB example to connect and pull info

Posted on 2004-10-07
6
Medium Priority
?
1,770 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

834 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