MS Acess database and Abyss together...

 
Post new topic   Reply to topic    Aprelium Forum Index -> Classic ASP
View previous topic :: View next topic  
Author Message
creativitum
-


Joined: 21 May 2004
Posts: 1

PostPosted: Sat May 22, 2004 8:07 am    Post subject: MS Acess database and Abyss together... Reply with quote

Hi, I've big problems with the code under here.

<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open db_koppling
SQL = "Select * From news"
Set RS = Conn.Execute(SQL)
RS.AddNew
RS("news_author") = Request.Form("author")
RS("news_addate") = Date
RS("news_newspost") = Request.Form("newspost")

RS.Close
Set Conn = Nothing

response.redirect "page_adminsystem.htm"

End if
%>

I get this errorcode:
ADODB.Recordset- Error '800a0cb3'
Current Recordset cannot be updated. It may depend on a limit by the provider, or the chosen locktype. (Translated from Swedish to English, so some "translation errors" may occur)

Is there anyone who could have a qualified guess to what's the problem with this is? Can't get this work, and really would like it to do. The "db_koppling" mentioned is these two lines, included in the file with the code written first in this post.
db_koppling is this;
<% dbase_path = Server.MapPath("files/photoforlife.mdb")
db_koppling = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="& dbase_path & ";"
%>

Somone?
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sun May 23, 2004 12:25 pm    Post subject: Re: MS Acess database and Abyss together... Reply with quote

Try replacing Server.MapPath("files/photoforlife.mdb") with the full path of this file your hard drive (for example, c:\server\htdocs\files\photoforlife.mdb ).

Does it work now?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
jm73
-


Joined: 11 May 2004
Posts: 1

PostPosted: Tue May 25, 2004 7:43 pm    Post subject: Reply with quote

if you're just adding one record, you might try changing

from:
-----------------------------------
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open db_koppling
SQL = "Select * From news"
Set RS = Conn.Execute(SQL)
RS.AddNew
RS("news_author") = Request.Form("author")
RS("news_addate") = Date
RS("news_newspost") = Request.Form("newspost")

RS.Close
Set Conn = Nothing
-----------------------------------

to:
-----------------------------------
SQL="INSERT INTO news (news_author, news_adddate, news_newspost) VALUES ('" & request.form("author") & "', #" & date(now()) & "#, '" & request.form("newspost") & "');"

set conn=server.createobject("adodb.connection")
conn.open db_koppling
conn.execute(SQL)
set conn=nothing
-----------------------------------

I added the # sign around the date assuming the field is set as a date in your database.
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Classic ASP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group