Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection to lotus notes through Visual Basic

Status
Not open for further replies.

ganusha

Programmer
May 1, 2002
28
US
Hi
I need to connect to lotus notes database through Visual Basic either using lotus notes odbc driver or through any other method
Can anyone please help
Thanks
 
Use the lotus notes Dominio COM objects.

Code:
    Dim Session As New NotesSession
    Dim DBDir As NotesDbDirectory
    Dim FieldItem As NotesItem

    On Error GoTo ErrorCatch

    'Need to store and retrieve password.
    '****** Must do dynamically for local user *******.
    Call Session.Initialize("[B]Password[/b]")
      
    'Set the Server and DB objects.
    '****** Must store server and DB values in tables ******.
    Set DBDir = Session.GetDbDirectory("[b]Serverpath[/b]")
    Set vDispatchDB = DBDir.OpenDatabase"[b]somthing.nsf[/b]", False)
.
.
.
 
Hi
Thanks for the istant reply.
My database is in C:\lotus\notes\data\sample.nsf

and in get dbdir i give the serverpath as C:\lotus\notes\data but in

opendatabase i tried to give the path and the name of the database, it doesn't open the database and the error given is database open failed.

Also i tried getting connected with notessql driver wherein i can use sql to query the database but even that failed.

can u figure out what the problem is??

Thanks

 
i got connected but how do i query the database??

can u help
Thanks
Usha
 
There is an ODBC DSN-Less connection that you could try.

oConn.Open "Driver={Lotus NotesSQL 3.01 (32-bit) ODBC DRIVER (*.nsf)};" & _
"Server=myServerName;" & _
"Database=mydir\myDbName.nsf;" & _
"Uid=myUsername;" & _
"Pwd=myPassword" & _
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top