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

February 13th, 2007, 11:39 PM
|
|
Friend of Wrox
|
|
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Your error with the direct insert statement sounds like something other than the permissions problem. Lets solve that so it works and you get the real error that I am suspecting.
Woody Z
http://www.learntoprogramnow.com
|
|

February 14th, 2007, 02:12 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
From the server's perspective the same, physical folder like c:\Users\You\Database is used.
However, your hosts has given you web access to change the settings through a web interface. What they let you change, and how you can do it, depends on the host, but the net result is the same: changed NTFS settings for the folder where the database resides.
At run-time, lock files are written to the folder where the database lives, so make sure you change settings for the entire folder, not just for the .mdb file.
If all this doesn't work, and you ruled out the folder setting can you post the last version of your code? I think Woody is right that the error message is a different problem from the permissions one....
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|
|

February 15th, 2007, 08:40 PM
|
|
Authorized User
|
|
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi.
So, as far as I can tell, Imar and Woodyz, it isn't a permissions problem. I can post my code, but...
First I'll explain how it is set up. this could be the problem. I have a register.asp page. The form action is "thanks.asp", so when the user hits submit, they go to thanks.asp. All the INSERT INTO code is in the thanks.asp page. Is this ok??
I've been busy trying to fix this problem since the last post. I have 2 different versions of this page now. I have a .AddNew code page, and an INSERT INTO page to handle the record insertion into my database. I will post the code for the INSERT INTO page. This is my new attempt. I'm not to familiar with the INSERT INTO, so there may be some errors here:
<%@LANGUAGE="VBSCRIPT"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<%
Dim objConn
Dim dbPath
Dim strSQL
Dim tableName
Dim rscustomers
dbPath="/db/Hockeycards.mdb"
sConnection="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath(dbPath) & ";"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.mode =3 '3="adModeReadWrite
LockType="adLockOptimistic"
Set rscustomers = Server.CreateObject("ADODB.Recordset")
tableName="CustomerList"
strSQL="SELECT * FROM CustomerList"
rscustomers.Open strSQL, sConnection
CursorType="adOpenKeyset"
CursorLocation="adUseServer"
FirstName = Request.Form("FirstName")
LastName =Request.Form("LastName")
Uname=Request.Form("Uname")
Pass=Request.Form("Pass")
Email=Request.Form("Email")
PhoneNumber=Request.Form("PhoneNumber")
FavoriteNHLPlayer=Request.Form("FavoriteNHLPlayer" )
BillingAddress=Request.Form("BillingAddress")
BillingCity=Request.Form("BillingCity")
BillingProvince=Request.Form("BillingProvince")
BillingPostalCode=Request.Form("BillingPostalCode" )
ShippingAddress=Request.Form("ShippingAddress")
ShippingCity=Request.Form("ShippingCity")
ShippingProvince=Request.Form("ShippingProvince")
ShippingPostalCode=Request.Form("ShippingPostalCod e")
Newsletter=Request.Form("Newsletter")
If (Request.Form("Submit") <>"") Then
INSERT INTO "CustomerList" (`FirstName`, `LastName`, `Uname`, `Pass`, `Email`, `PhoneNumber`, `FavoriteNHLPlayer`, `ShippingAddress`, `ShippingCity`, `ShippingProvince`, `ShippingPostalCode`, `BillingAddress`, `BillingCity`, `BillingProvince`, `BillingPostalCode`, `Newsletter`)
VALUES(FirstName, LastName, Uname, Pass, Email, PhoneNumber, FavoriteNHLPlayer, ShippingAddress, ShippingCity, ShippingProvince, ShippingPostalCode, BillingAddress, BillingCity, BillingProvince, BillingPostalCode)
End If
rscustomers.Close
Set rscustomers = Nothing
Set objConn = Nothing
%>
So there it is. Heads UP! I get an error saying expected end of statement at the end of the first INSERT INTO. Odd. Again, I'm not familiar with the INSERT INTO, I was more used to this .AddNew code.
Any help would be great.
Thanks in advance.
Invisible Bunny King
Now is the only thing that's real.
|
|

February 16th, 2007, 02:50 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
INSERT INTO is a SQL command, not an ASP command. So, you can't just execute INSERT INTO in your ASP code.
Instead, you need to assign it to a string and the execute it against an open connection, just as you do with the SELECT in strSql.
E.g.:
Dim mySqlStatement
mySqlStatement = "INSERT INTO ....."
rscustomers.Execute(mySqlStatement)
rscustomers.Close
Also, you can't use the variables directly. Instead, you'll need to concatenate the values:
mySqlStatement = "INSERT INTO ..... VALUES('" & FirstName & "', '" & ...
This adds the values of the FirstName to the SQL statement.
If all of this is very new to you, maybe you are better off using AddNew.... Or, just to make sure it works, fire a really simple INSERT statement, with a single field for example.
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|
|
 |