Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > Oracle ASP
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Oracle ASP Using ASP with Oracle databases. For Oracle discussions not specific to ASP, please see the Oracle forum. For more ASP discussions, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle ASP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 4th, 2006, 09:17 AM
Registered User
Join Date: Apr 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default inserting records in oracle from asp page


I appreciate any help, I can get, as I have been looking at this code for 3 days now and am at a loss.

I have an input form page in html that allows users to enter values. Once submitted it goes to addV.asp page. This page adds values to different tables(bns_info_tbl and cns_info_tbl).

str_SQL_business adds values to table if executed alone. str_SQL_contact2 when executed does not work. I checked the name of fields, everything is correct. the only thing I can think of is that's different is that cns_info_tbl has a foreign key that references the primary key in bns_info_tbl.

 addV.asp is set in such a way that if all SQL strings are executed with no errors then save changes to database. Below is the code;

conn.BeginTrans 'start the transaction'

str_SQL_business= "INSERT INTO bns_info_tbl(b_name,b_address,b_city,b_state,b_zip code,b_phone) VALUES"
str_SQL_business=str_SQL_business + "('" & Request.Form("name") & "','" & Request.Form("address") & _
"','" & Request.Form("city")& "','"& Request.Form("state")& "'," &_ Request.Form("zipcode")&","& Request.Form("phone")&")"

str_SQL_contact2="INSERT INTO cns_info_tbl(c_name,c_title,c_email,c_phone) VALUES"
str_SQL_contact2=str_SQL_contact2 + "('"& Request.Form("cname") & "','"& Request.Form("ctitle") &_
"','"& Request.Form("cemail")& "',"& Request.Form("cphone")& ")"

response.write ("'" & str_SQL_contact2 &"'")

    Response.Write("Execute sql-1 statment ")
    if conn.Errors.Count =0 Then
    response.write("no errors sql-1.")
    end if
    Response.Write("Execute sql-2 statment ")
    if conn.Errors.Count =0 Then
    response.write("no errors sql -2.")
    end if

once executed, I get the following output:
'INSERT INTO cns_info_tbl(c_name,c_title,c_email,c_phone) VALUES('steve white','manager','steve@jong.edu',1234567890)'
Execute sql-1 statment no errors sql-1. Execute sql-2 statment

So nothing gets saved to database as str_SQL_contact2 produces an error. Except I just dont know why.



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
inserting and updating records in classic asp codetoad Classic ASP Databases 2 March 21st, 2007 07:40 AM
Inserting records to Oracle db from asp page jowjow Classic ASP Basics 0 April 4th, 2006 09:24 AM
Executing Oracle Scripts from ASP Page acpt Classic ASP Basics 0 May 3rd, 2005 08:33 AM
Connecting Oracle Database with an ASP page krisvamshi Oracle ASP 3 November 14th, 2004 05:56 PM
Want to show Records on ASP Page randomly pkdev Classic ASP Databases 3 July 28th, 2003 03:20 AM

All times are GMT -4. The time now is 04:51 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.