Ask the Expert

Using VB script on a Web server and submitting online forms to a Lotus database

Is it possible to use VBscript on a Web server and submit online forms to a Lotus database? If yes, how do I refer to or point to the database from VB script?
Yes, you could do it in at least two ways that I can think of. If you have a Domino server running HTTP, you could simply make the ACTION attribute of the
tag point to a form or agent in the database that will process the data. Alternatively, you could write an ASP page that uses COM to access the Domino objects to add the form content to a database. Keep in mind that COM only supports the back-end classes for Domino. I have added a simple example below, which is code I put in the click event of a button on a VB form.

Private Sub Command1_Click()
' Last mods 020518 - dhatter@libertastechnologies.com -
www.libertastechnologies.com
Set nsCurrent = CreateObject("Lotus.NotesSession")
Dim ndbTarget As NotesDatabase
Dim ndocTarget As NotesDocument
Dim arrRecipients(3) As String
arrRecipients(0) = "John Galt"
arrRecipients(1) = "Hank Rearden"
arrRecipients(2) = "Dagny Taggart"
arrRecipients(3) = "Sebastian D'Aconio"
Call nsCurrent.Initialize
Set ndbTarget = nsCurrent.GetDatabase("", "C:program
fileslotusnotesdatadhatter.nsf")
Set ndocTarget = ndbTarget.CreateDocument
Stop
With ndocTarget
Call .ReplaceItemValue("Form", "Memo")
Call .ReplaceItemValue("Subject", Subject.Text)
Call .ReplaceItemValue("Body", Body.Text)
Call .Save(True, False)
Call .Send(False, arrRecipients)
End With
MsgBox "COM example completed successfully",
64, "www.libertastechnologies.com"
End Sub

This was first published in May 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: