Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_database_setup thread: SQL Server to MS Access database


Message #1 by "'Name Removed'" <Name Removed> on Mon, 13 May 2002 11:19:34
I exported an SQL Server database (which is used to record usernames and 
passwords for a web administration panel on a website), to MS access.

I've set the database path correctly, and I manage to connect to the MS 
access database from my ASP pages using data can be read with no problems 
using my ASP pages using OLEDB. The problem is that I can only read data - 
I'm not able to add new records to the access database.

Basically, it seems that I'm getting an HTTP 500 Internal server error 
when rs.AddNew is executed.

If you know what could be wrong, please let me know.

Cheers,
Nasos  
Message #2 by Nikos <pappas@c...> on Mon, 13 May 2002 14:43:56 +0300
Hi Naso
Is it necessary to use a recordset to insert a new record?
Just the connection is enough with an INSERT sql statement and execute it.
The other thing is check permissions for your database folder.
I Hope it helps
Nikos Pappas
At 14:19 13/05/2002, you wrote:
>I exported an SQL Server database (which is used to record usernames and
>passwords for a web administration panel on a website), to MS access.
>
>I've set the database path correctly, and I manage to connect to the MS
>access database from my ASP pages using data can be read with no problems
>using my ASP pages using OLEDB. The problem is that I can only read data -
>I'm not able to add new records to the access database.
>
>Basically, it seems that I'm getting an HTTP 500 Internal server error
>when rs.AddNew is executed.
>
>If you know what could be wrong, please let me know.
>
>Cheers,
>Nasos
>%%email.unsub%%
>

Message #3 by "Drew, Ron" <RDrew@B...> on Mon, 13 May 2002 08:04:29 -0400
First go into your browser options and turn Friendly HTTP messages on.
Then go to the directory the mdb is in and right click on the directory.
Then properties, then check to make sure the security is set to EVERYONE
with update/create access and not just readonly.

-----Original Message-----
From: Name Removed [mailto:'Name Removed']
Sent: Monday, May 13, 2002 7:20 AM
To: ASP Database Setup
Subject: [asp_database_setup] SQL Server to MS Access database


I exported an SQL Server database (which is used to record usernames and

passwords for a web administration panel on a website), to MS access.

I've set the database path correctly, and I manage to connect to the MS
access database from my ASP pages using data can be read with no
problems
using my ASP pages using OLEDB. The problem is that I can only read data
-
I'm not able to add new records to the access database.

Basically, it seems that I'm getting an HTTP 500 Internal server error
when rs.AddNew is executed.

If you know what could be wrong, please let me know.

Cheers,
Nasos 
%%email.unsub%%

Message #4 by "Drew, Ron" <RDrew@B...> on Mon, 13 May 2002 08:09:22 -0400
You can use addnew ...here is an example (I have an autonumber)....check
your permissions.
<%@ Language=3DVBScript %>
<%Option Explicit%>
<!-- #INCLUDE FILE=3D"include/adovbs.inc" -->
<%
  if Request.Form("passit") =3D "Y" then
   Dim  strfirstname
   strfirstname =3D Request.Form("firstname")
   Dim  objConn, objRS, intID, mdbPath
   set objConn =3D Server.CreateObject("ADODB.Connection")
   mdbPath =3D Server.MapPath("xxx.mdb")
   objConn.Open "Provider=3DMicrosoft.Jet.OLEDB.4.0;" & _
                "Data Source=3D" & mdbPath & ";" & _
                "User Id=3Dadmin;" & _
                "Password=3D;"       
  set objRS =3D Server.CreateObject("ADODB.Recordset")
  objRS.Open
"tablename",objConn,adOpenForwardOnly,adLockOptimistic,adCmdTable
  objRS.AddNew
    objRS.Fields("firstname") =3D strfirstname
  objRS.Update
  intID =3D objRS("pcID")
  Response.Write "<p><B><font size=3D6>Record ID " & intID & "
added</font><b></p>"
  objRS.Close
  set objRS =3D Nothing
  objConn.Close
  set objConn =3D Nothing
  set intID =3D Nothing
  end if
%>

-----Original Message-----
From: Nikos [mailto:pappas@c...]
Sent: Monday, May 13, 2002 7:44 AM
To: ASP Database Setup
Subject: [asp_database_setup] Re: SQL Server to MS Access database


Hi Naso
Is it necessary to use a recordset to insert a new record?
Just the connection is enough with an INSERT sql statement and execute
it. The other thing is check permissions for your database folder. I
Hope it helps Nikos Pappas At 14:19 13/05/2002, you wrote:
>I exported an SQL Server database (which is used to record usernames
>and passwords for a web administration panel on a website), to MS
>access.
>
>I've set the database path correctly, and I manage to connect to the MS

>access database from my ASP pages using data can be read with no
>problems using my ASP pages using OLEDB. The problem is that I can only

>read data - I'm not able to add new records to the access database.
>
>Basically, it seems that I'm getting an HTTP 500 Internal server error
>when rs.AddNew is executed.
>
>If you know what could be wrong, please let me know.
>
>Cheers,
>Nasos
>pappas@c... 
>%%email.unsub%%
>
>---
>Change your mail options at http://p2p.wrox.com/manager.asp or to
>unsubscribe send a blank email to 


%%email.unsub%%


  Return to Index