View previous topic :: View next topic |
Author |
Message |
creativitum -
Joined: 21 May 2004 Posts: 1
|
Posted: Sat May 22, 2004 8:07 am Post subject: MS Acess database and Abyss together... |
|
|
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 |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sun May 23, 2004 12:25 pm Post subject: Re: MS Acess database and Abyss together... |
|
|
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 |
|
|
jm73 -
Joined: 11 May 2004 Posts: 1
|
Posted: Tue May 25, 2004 7:43 pm Post subject: |
|
|
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 |
|
|
|