Urgent: CreateObject?

Hi,

I have trouble with my web-based domino script if I put it in the server.

It turned out that the line that gives error is:

Set Connect = CreateObject(“ADODB.Connection”)

Now, I don’t understand this since it works in local environment. Is there any setting in the server I shoud set ? or is there any properties that I need to set ?

Thank you very much.

Subject: RE: Urgent: CreateObject?

Please see this link for samples of connection codes:http://www.tnsites.com/support/s_databaseconn.asp

Offhand, I would say that you have a DSN configured on your local, but that your server does not.

Subject: RE: Urgent: CreateObject?

Thank you for your reply.

The thing is that other nsf can access database properly. And so far, all nsf that I worked for, if it works on local, it works in the server too.

Note that the error is not when I tried to open connection, but it’s when I tried to create the connection object.

Subject: RE: Urgent: CreateObject?

What error message are you getting? CAn you post it here?

Subject: RE: Urgent: CreateObject?

Unfortunately since it is web based, I don’t get error message, the data is simply not displayed in the web page.

Is there anyway to see the error message ?

For debugging purpose, I created a field which print a message if everything is all right. But not if I put the string after the CreateObject statement.

edit -

I created a simple form to be previewed in Lotus Notes and I got this error:

Object variable not set

But this error is on different line, CreateObject doesn’t give error in Notes. It errored when it attempted to get the value from the database:

somevariable = Recordset.fields(0).value

Subject: RE: Urgent: CreateObject?

Object variable not set indicates the recordset was not created. If you say that the creatobject statement works in other databases, then the fault is with the next lines of your code. It may create the object, but either the qry or result is failing.

Try pasting the code from a database that works in this database… if that code works, then you can assume that the fault lies with whatever is different in this database… i.e. the queried table may be locked for reading, or locked to read permissions, any number of things.

Subject: RE: Urgent: CreateObject?

Thank you for your reply.

I fixed the Object variable set error. It works now in Lotus Notes, but still doesn’t work in web.

If I only have something like this:

doc.TempField1 = “Before Create Object”

Connect = CreateObject(“ADODB.Connection”)

doc.TempField2 = “After Create Object”

“Before Create Objet” is displayed in the field while “After Create Object” is not. Clearly, there is an error in the CreateObject statement, while that statement is working properly in the server if I open it with lotus notes. And it also works properly in local machine both in lotus notes and web.

The thing is that when I display it on the web, I don’t know what the error message is.

Subject: RE: Urgent: CreateObject?

Then the fault lies with the agent security… the runtime security for the agent probably needs to be set to either #2 or #3.

Also, if the agent is running on the server and throws an error, it should appear in the Administration console, or the http log.

Subject: RE: Urgent: CreateObject?

Setting the agent’s security to #2 did the job.

Thank you very much Marilyn. But I was wondering why the old script worked with security #1 though, is it because it was developed in Lotus 5 instead of 6.5 ?

Subject: RE: Urgent: CreateObject?

Yup, the property is new to R6