|
 |
asp_databases thread: Re: Problems Adding Records via ASP/ADO
Message #1 by "Jeff McKinney" <jeff.mckinney@e...> on Tue, 7 May 2002 19:13:00
|
|
The ISP resolved the problem. It was a permissions problem. Thanks.
> probably is only a problem of permission
on the folder. Are you using Access?
----- Original Message -----
From: "Jeff McKinney" <jeff.mckinney@e...>
To: "ASP Databases" <asp_databases@p...>
Sent: Thursday, May 02, 2002 8:38 PM
Subject: [asp_databases] Problems Adding Records via ASP/ADO
> I am experiencing problems with posting information to an ODBC datasource
> (database) using ASP. My code is fine as I have tested it on other
servers
> including the Personal Web Server and it works fine. However, on my ISPs
> server it does not work. To see the error go to my homepage
> www.webzstudios.com and select ADD DVD button. This will bring up a small
> window. Type in a DVD name (anything is fine) and click submit. The
server
> returns an error saying "The page cannot be displayed" and it does not
> post the data to the database. Again, this same exact code works on other
> servers - not on my ISPs. Here is my code for the asp page in question:
>
> <% Response.Buffer = True %>
> <%
> Set DVDDB = Server.CreateObject("ADODB.Connection")
> DVDDB.Open "DVDs"
> SQLQuery1 = "SELECT * FROM DVDStatus WHERE Owner = '" + Request.Form
> ("Owner") + "' AND Title = '" + Request.Form("Title") + "'"
>
> Set RSTitle = DVDDB.Execute(SQLQuery1)
> %>
> <% recStat = RSTitle.BOF Or RSTitle.EOF %>
> <% If recStat <> "True" then %>
> <% Response.Clear %>
> <script language="JavaScript"></script>
> <% End If %>
> <% Else %>
> <% recValues = "'" + Request.Form("Owner") + "', '" + Request.Form
> ("Title") + "')" %>
> <% DVDDB.Execute "INSERT INTO DVDStatus (Owner, Title) VALUES (" +
> recValues %>
> <% Response.Clear %>
> <script language="JavaScript"></script>
> <% End If %>
>
> I have tried many different things to try and isolate the problem. I have
> narrowed it down to the "Execute" statement in line 18. I remove this
line
> and the error goes away. I add it back in and the error comes back.
> Problem is that this statement is what actually posts the SQL statement
to
> the database to add the record. Now I checked my syntax against what
> Microsoft specifies and it checks out OK. Check the following Microsoft
> URL for the details (http://msdn.microsoft.com/library/default.asp?
> url=/library/en-us/iisref/html/psdk/asp/iiwadata.asp). Also I stripped
the
> code down to its basic elements and it still would not work. I am
> convinced this is a problem on the server side. For some reason the
server
> does not like it when I try to Execute a database write. Incidently,
> reading from the database works fine. This is demonstrated by my home
page
> where it lists out the DVDs from the database. What can be the problem?
> What can be done to allow me to be able to write to my database?
>
> P.S. I am using an MS Access database and the ISP says they support this
> function. The database was initially populated on my end then published
to
> the website.
>
> Any ideas?
>
> Thanks.
>
Message #2 by "Giovanni Salucci" <g.salucci@n...> on Thu, 2 May 2002 22:03:09 +0200
|
|
probably is only a problem of permission
on the folder. Are you using Access?
----- Original Message -----
From: "Jeff McKinney" <jeff.mckinney@e...>
To: "ASP Databases" <asp_databases@p...>
Sent: Thursday, May 02, 2002 8:38 PM
Subject: [asp_databases] Problems Adding Records via ASP/ADO
> I am experiencing problems with posting information to an ODBC datasource
> (database) using ASP. My code is fine as I have tested it on other servers
> including the Personal Web Server and it works fine. However, on my ISPs
> server it does not work. To see the error go to my homepage
> www.webzstudios.com and select ADD DVD button. This will bring up a small
> window. Type in a DVD name (anything is fine) and click submit. The server
> returns an error saying "The page cannot be displayed" and it does not
> post the data to the database. Again, this same exact code works on other
> servers - not on my ISPs. Here is my code for the asp page in question:
>
> <% Response.Buffer = True %>
> <%
> Set DVDDB = Server.CreateObject("ADODB.Connection")
> DVDDB.Open "DVDs"
> SQLQuery1 = "SELECT * FROM DVDStatus WHERE Owner = '" + Request.Form
> ("Owner") + "' AND Title = '" + Request.Form("Title") + "'"
>
> Set RSTitle = DVDDB.Execute(SQLQuery1)
> %>
> <% recStat = RSTitle.BOF Or RSTitle.EOF %>
> <% If recStat <> "True" then %>
> <% Response.Clear %>
> <script language="JavaScript"></script>
> <% End If %>
> <% Else %>
> <% recValues = "'" + Request.Form("Owner") + "', '" + Request.Form
> ("Title") + "')" %>
> <% DVDDB.Execute "INSERT INTO DVDStatus (Owner, Title) VALUES (" +
> recValues %>
> <% Response.Clear %>
> <script language="JavaScript"></script>
> <% End If %>
>
> I have tried many different things to try and isolate the problem. I have
> narrowed it down to the "Execute" statement in line 18. I remove this line
> and the error goes away. I add it back in and the error comes back.
> Problem is that this statement is what actually posts the SQL statement to
> the database to add the record. Now I checked my syntax against what
> Microsoft specifies and it checks out OK. Check the following Microsoft
> URL for the details (http://msdn.microsoft.com/library/default.asp?
> url=/library/en-us/iisref/html/psdk/asp/iiwadata.asp). Also I stripped the
> code down to its basic elements and it still would not work. I am
> convinced this is a problem on the server side. For some reason the server
> does not like it when I try to Execute a database write. Incidently,
> reading from the database works fine. This is demonstrated by my home page
> where it lists out the DVDs from the database. What can be the problem?
> What can be done to allow me to be able to write to my database?
>
> P.S. I am using an MS Access database and the ISP says they support this
> function. The database was initially populated on my end then published to
> the website.
>
> Any ideas?
>
> Thanks.
>
Message #3 by "Jeff McKinney" <jeff.mckinney@e...> on Thu, 2 May 2002 20:38:14
|
|
I am experiencing problems with posting information to an ODBC datasource
(database) using ASP. My code is fine as I have tested it on other servers
including the Personal Web Server and it works fine. However, on my ISPs
server it does not work. To see the error go to my homepage
www.webzstudios.com and select ADD DVD button. This will bring up a small
window. Type in a DVD name (anything is fine) and click submit. The server
returns an error saying "The page cannot be displayed" and it does not
post the data to the database. Again, this same exact code works on other
servers - not on my ISPs. Here is my code for the asp page in question:
<% Response.Buffer = True %>
<%
Set DVDDB = Server.CreateObject("ADODB.Connection")
DVDDB.Open "DVDs"
SQLQuery1 = "SELECT * FROM DVDStatus WHERE Owner = '" + Request.Form
("Owner") + "' AND Title = '" + Request.Form("Title") + "'"
Set RSTitle = DVDDB.Execute(SQLQuery1)
%>
<% recStat = RSTitle.BOF Or RSTitle.EOF %>
<% If recStat <> "True" then %>
<% Response.Clear %>
<script language="JavaScript"></script>
<% End If %>
<% Else %>
<% recValues = "'" + Request.Form("Owner") + "', '" + Request.Form
("Title") + "')" %>
<% DVDDB.Execute "INSERT INTO DVDStatus (Owner, Title) VALUES (" +
recValues %>
<% Response.Clear %>
<script language="JavaScript"></script>
<% End If %>
I have tried many different things to try and isolate the problem. I have
narrowed it down to the "Execute" statement in line 18. I remove this line
and the error goes away. I add it back in and the error comes back.
Problem is that this statement is what actually posts the SQL statement to
the database to add the record. Now I checked my syntax against what
Microsoft specifies and it checks out OK. Check the following Microsoft
URL for the details (http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/iisref/html/psdk/asp/iiwadata.asp). Also I stripped the
code down to its basic elements and it still would not work. I am
convinced this is a problem on the server side. For some reason the server
does not like it when I try to Execute a database write. Incidently,
reading from the database works fine. This is demonstrated by my home page
where it lists out the DVDs from the database. What can be the problem?
What can be done to allow me to be able to write to my database?
P.S. I am using an MS Access database and the ISP says they support this
function. The database was initially populated on my end then published to
the website.
Any ideas?
Thanks.
|
|
 |