Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 22nd, 2003, 11:00 AM
Authorized User
 
Join Date: Jul 2003
Location: Houston, Texas, USA.
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nvillare
Default Unable to INSERT INTO db

I am having much difficulty inderting my data into the database. I have a form that is suppose to:
1. allow the useer to input information
2. checks to see if everything has been filled
3. send the information to the database.

Everything is done except for the insert part

code:
 dim RS
 dim MySQL
 set RS = Server.CreateObject("ADODB.Recordset")
 MySQL = "INSERT INTO SignIn (theDate, theName, Email, Location, Comments)"
 MySQL = MySQL & " VALUES ('" & Date() & "','"
 MySQL = MySQL & theName &"','"
 MySQL = MySQL & Email &"','"
 MySQl = MySQL & Location &"','"
 MySQL = MySQL & Comments &"')"

 RS.Open MySQL, conn

can anyone make any suggestions??

Thanks!

nvillare
__________________
Thanks!

N
 
Old August 22nd, 2003, 11:22 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What error are you getting? I'm not sure what you are asking.

One thing you can change is the last line:
change
    RS.Open MySQL, conn
to
    conn.Execute(mySQL)

You don't need a RecordSet if you aren't returning anything.
Give that a try and you get another error, post it.

------------------------
Peter
Somewhere outside
Boston, MA USA Earth
 
Old August 25th, 2003, 08:41 AM
Authorized User
 
Join Date: Jul 2003
Location: Houston, Texas, USA.
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nvillare
Default

I tried that and still no success.

Code
 'insert data into the database
 dim MySQL
 MySQL = "INSERT INTO SignIn (theDate, theName, Email, Location, Comments)"
 MySQL = MySQL & " VALUES ('" & Date() & "','"
 MySQL = MySQL & theName &"','"
 MySQL = MySQL & Email &"','"
 MySQl = MySQL & Location &"','"
 MySQL = MySQL & Comments &"')"
conn.Execute(MySQL)

Also, here is the include file for my connection:

<%
  dim connString
  dim conn

  connString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=\\ohowweb9\\oogc_app\departments\exploration\e p_resources\Geoscience\DB\data.mdb"
  Set conn = Server.CreateObject("ADODB.Connection")
  conn.Open connString

%>

Because this is a company server, it does not allow for friendly messages. The only error I get is:

There is a problem with the page you are trying to reach and it cannot be displayed.

HTTP 500 - Internal server error
Internet Explorer

Please Help!!

Thanks!

nvillare
 
Old August 25th, 2003, 09:58 AM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can you do a
Response.write MySQL
Response.end

and post what is says..

Chintu


 
Old August 25th, 2003, 11:58 AM
Authorized User
 
Join Date: Jul 2003
Location: Houston, Texas, USA.
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nvillare
Default

INSERT INTO SignIn (theDate, theName, Email, Location, Comments) VALUES ('8/25/2003','nidiaedith','nidia@aol.com','houston','Test ing the SQL string.')

The SQL looks fine. Do you think it may have to do with the connection?



Thanks!

nvillare
 
Old August 25th, 2003, 08:19 PM
Authorized User
 
Join Date: Jun 2003
Location: Quezon City, MM, Philippines.
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to planeswalk
Default

Hi,

Try disabling the default browser error messages. In your IE, go to Tools->Internet Options, then on the Internet Options panel click on the Advanced tab and uncheck the option named "Show friendly HTTP error messages" under the "Browsing" section. You should see the exact ASP error instead of the ambiguous HTTP 500 message.

Cheers!


Marlon Villarama
Support Team
Web Burner Hosting
marlon@webburner.com
www.webburner.com
Toll-Free: 877-535-2876
 
Old August 26th, 2003, 10:29 AM
Registered User
 
Join Date: Jun 2003
Location: karachi, , Pakistan.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to asifqua
Default

u r using recordset but not to defining the locktype , recordset type etc.define them when u r open recordset. may be it solve ur problem.
Asif Hameed




Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to insert comment thuyvncr BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 June 4th, 2007 11:57 PM
Unable to open ProjectTimeTracker DB cancer2006 BOOK: Beginning VB.NET Databases 2 October 24th, 2006 03:53 PM
Unable to import db The Beginner SQL Server 2000 9 August 24th, 2006 06:03 AM
unable to insert records into database everest Classic ASP Databases 11 March 22nd, 2004 02:28 PM
unable to insert records into access DB bn_sree Access ASP 0 October 8th, 2003 08:38 AM





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