Print Page | Close Window

Connecting to a database

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=7266
Printed Date: 30 March 2026 at 12:17pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Connecting to a database
Posted By: eden24
Subject: Connecting to a database
Date Posted: 14 November 2003 at 5:37am

Hi.

 

I am quite new to ASP but have been trying out the tutorial for database connection, however i get the following error:

Error Type:
ADODB.Connection (0x800A0E79)
Operation is not allowed when the object is open.
/guestbook.asp, line 22

Can anyone help?.

 

E.




Replies:
Posted By: Tegwin
Date Posted: 14 November 2003 at 6:00am
This could be relalating to permissions. CHeck to make sure that IUSR has read/write access to that folder that holds the db




-------------
If you dont want my peaches, dont shake my tree


Posted By: ljamal
Date Posted: 14 November 2003 at 11:46am
Be sure that the RecordSet Object that you are using is closed before you try to use it again.

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: eden24
Date Posted: 16 November 2003 at 8:02am

Thanks for the response, I have managed to resolve that problem now but I have anotehr query regarding submitting a form that I am working on.

I am trying to declare the variables for all of the headings within my form, however I am getting the following error:

Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/example/Bookings_process.asp, line 15, column 124
Dim Firstname, Secondname, Organisation, Position, Address_1, Address_2, Address_3, Postcode, Telephone, Fax, Mobile, Web, E-Mail, Request, Service, Therapies, Events, Training, Comments, theDate,sql

I have successfully tried the tutorial using just 3 fields but obviously I need to have all of the fields available form my form to work, can you advise what I should have added?

 

Regards,

 

M.



Posted By: Flamewave
Date Posted: 19 November 2003 at 11:27am

if you wrap the DIM statment to a second line, then that is probally what your problem is. Try doing one of the following:

add a _ to the end of the first line so the script knows to continue to the next line, ex
Dim Firstname, Secondname, Organisation, Position, Address_1, Address_2, Address_3, Postcode, Telephone, Fax, _
Mobile, Web, E-Mail, Request, Service, Therapies, Events, Training, Comments, theDate,sql

add a second DIM statment, ex
Dim Firstname, Secondname, Organisation, Position, Address_1, Address_2, Address_3, Postcode, Telephone, Fax,
Dim Mobile, Web, E-Mail, Request, Service, Therapies, Events, Training, Comments, theDate,sql

The _ character when used in this fasion is basically a line terminator that tells the script that the line contiues on the next line. If you put anything, including comments, after the _, you will also get an error, as ASP expects nothing after it.



-------------
- Flamewave

They say the grass is greener on the other side, but if you really think about it, the grass is greener on both sides.


Posted By: RonMcF
Date Posted: 18 December 2003 at 9:55pm

Thought I'd share a tidbit that solved an ODBC connectivity problem for me with the guestbook database tutorial, as used with IIS 5.0 & W2K. The IUSR must have R+W permissions wherever the db containing folder is at, of course. But it was also necessary for me to change the *system* TEMP and TMP environment variables to point at a folder named TEMP in the root of (any) drive and to give the IUSR R+W permission there, too. That TEMP folder is apparently used when ODBC is used from ASP. I don't know if the problem was specific to Access97 or not, but the tutorial started working for me immediately after I made that change to the system environment variables and rebooted.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net