Support Requests item #429141, was updated on 2001-05-31 13:48
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=203152&aid=429141&group_id=3152

Category: Configuration: Database
Group: aolserver3_4
Status: Open
Priority: 5
Submitted By: Tyge Cawthon (tyge)
Assigned to: Nobody/Anonymous (nobody)
Summary: help w/data from AOL into Postgresql

Initial Comment:
I have done a lot of reading and I am stuck.
I would appreciate any help.

I am using FreeBSD 4.3, AOL 3.4 and postgreSQL all on
the same system.
I have created a database called tyge a table called
customer and a field called name.

I started postgresql with the postmaster -i option.
This is the default Host: localhost Port:5432

I can use the SQL commands to insert data into the
"name" field", but when I try using HTML, ADP (TCL)
with AOL I get the following error message.

[31/May/2001:15:27:39][3282.135895040][-conn4-] Error:
command "ns_db" is not enabled
    while executing
"ns_db gethandle"
    invoked from within chunk: 0 of adp:
/usr/local/aolserver/servers/server1/pages/tygedb.adp

my config.tcl use by my AOL server is the default setup
with the exception of the commands below.

# What is needed for connecting to a data base
# Added by Tyge Cawthon 5/14/01
#
     ns_section "ns/server/server1/db"
     ns_param pools *

    ns_section "ns/db/drivers"
    ns_param postgres nspostgres.so
#    ns_param solid nssolid.so

    ns_section "ns/db/pools"
     ns_param mypool "The Default Database Pool"
#    ns_param otherdb "The Other Database Pool"

    ns_section "ns/db/pool/mypool"
    ns_param driver postgres
    ns_param connections 2
    ns_param datasource "localhost:5432:tyge"
    ns_param LogSQLErrors on

#    ns_section "ns/db/pool/otherdb"
#    ns_param driver solid
#    ns_param connections 4
#    ns_param datasource "TCP/IP hostname 1313"
#
    ns_section "ns/server/server1/modules"
    ns_param nscp  nscp.so

    ns_section "ns/server/server1/module/nscp"
    ns_param port 9999
    ns_param address 127.0.0.1
    ns_param binary bin/nscp
#
# Tyge's statements end here





tygedb.html

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd";>
<html>
<head>
  <title>Customer Input Form</title>
  <meta http-equiv="Content-Type" content="text/html">
</head>

<body>
<h2>Customer Information</h2>

<form method="post" action="tygedb.adp" />
<p>
First Name   <input type="text" size="30" name="name">
</p>
<p>
  <input type="submit" value="Submit">
</p>
</form>
</body>
</html>


tygedb.adp
<HTML>
    <HEAD>
      <TITLE>Customer Input Information</TITLE>
    </HEAD>
    <BODY>
    <H2>
      Testing inputting customer information
    </H2>
    <P>
    Thank You for testing!

    <%
    # Get form data and assign to variables
    set r [ns_conn form $conn]
    set name       [ns_set get $r name]

    # Update database with new subscription
     set db [ns_db gethandle]
    # ns_db dml $db \
     ns_db dml tyge \
"insert into customer values ([ns_dbquotevalue $name])"

 \
    %>
    </BODY>
    </HTML>


----------------------------------------------------------------------

You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=203152&aid=429141&group_id=3152

Reply via email to