 |
| 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
|
|
|
|

August 22nd, 2003, 11:00 AM
|
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

August 22nd, 2003, 11:22 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
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
|
|

August 25th, 2003, 08:41 AM
|
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

August 25th, 2003, 09:58 AM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Can you do a
Response.write MySQL
Response.end
and post what is says..
Chintu
|
|

August 25th, 2003, 11:58 AM
|
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
INSERT INTO SignIn (theDate, theName, Email, Location, Comments) VALUES ('8/25/2003','nidiaedith',' [email protected]','houston','Test ing the SQL string.')
The SQL looks fine. Do you think it may have to do with the connection?
Thanks!
nvillare
|
|

August 25th, 2003, 08:19 PM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
[email protected]
www.webburner.com
Toll-Free: 877-535-2876
|
|

August 26th, 2003, 10:29 AM
|
|
Registered User
|
|
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|
 |