|
 |
asp_databases thread: Questions on ASP
Message #1 by "Phil Perks" <philp@w...> on Fri, 18 Aug 2000 14:47:18
|
|
----Original Message-----
From: Hung Luc [mailto:hungmail@m...]
Sent: 18 August 2000 02:26
To: philp@w...
Subject: Questions on ASP
I have recently bought a book called 'Beginning ASP Database' by
John Kauffman. After getting the write permission on my NT Server, and
when I tried to add/insert a new record into my MS Access *.mdb files. It
seems that it can't write to the database. It shows the error message as
follows.
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable
query.
/dsnupdat.asp, line 14
And here is my codes:
<%
' Open MS Access DB with DSN-LESS Method
Dim oCon, oRS
Set oCon = Server.CreateObject("ADODB.Connection")
Set oRS = Server.CreateObject("ADODB.Recordset")
oCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("db/petition.mdb")
sqlquery = "INSERT INTO MyTable (FirstName,LastName) " &_
"values('John','Smith')"
oCon.Execute(sqlquery)
Set oCon = Nothing
Set oRS = Nothing
%>
It would be greate if you can help me to solve this problem.
Thank you very much for your help.
Hung
hungmail@m...
Message #2 by ckoski@w... on Fri, 18 Aug 2000 10:05:11 -0400
|
|
I believe the answer is in the permissions for the DB via the IUSR_SERVER
account... if you set the permissions properly on the mdb file with the
IUSR_Server account, it should be fine...
I'm going by a problem I had a couple of months ago, and I'm not sure if I
totally remember it, but that should theoretically work.
Cory
----- Original Message -----
From: "Phil Perks" <philp@w...>
To: "ASP Databases" <asp_databases@p...>
Sent: Friday, August 18, 2000 2:47 PM
Subject: [asp_databases] Questions on ASP
> ----Original Message-----
> From: Hung Luc [mailto:hungmail@m...]
> Sent: 18 August 2000 02:26
> To: philp@w...
> Subject: Questions on ASP
>
>
> I have recently bought a book called 'Beginning ASP Database' by
> John Kauffman. After getting the write permission on my NT Server, and
> when I tried to add/insert a new record into my MS Access *.mdb files. It
> seems that it can't write to the database. It shows the error message as
> follows.
>
> Microsoft OLE DB Provider for ODBC Drivers error '80004005'
>
> [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable
> query.
>
> /dsnupdat.asp, line 14
>
> And here is my codes:
>
> <%
> ' Open MS Access DB with DSN-LESS Method
>
> Dim oCon, oRS
>
> Set oCon = Server.CreateObject("ADODB.Connection")
> Set oRS = Server.CreateObject("ADODB.Recordset")
>
> oCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
> Server.MapPath("db/petition.mdb")
>
> sqlquery = "INSERT INTO MyTable (FirstName,LastName) " &_
> "values('John','Smith')"
> oCon.Execute(sqlquery)
>
> Set oCon = Nothing
> Set oRS = Nothing
> %>
>
> It would be greate if you can help me to solve this problem.
>
> Thank you very much for your help.
>
> Hung
> hungmail@m...
>
Message #3 by "Ken Schaefer" <ken@a...> on Mon, 21 Aug 2000 10:49:24 +1000
|
|
Check the server permissions.
The IUSR_Computername account needs READ, WRITE and DELETE permissions (eg
CHANGE) to both the Access file, and to the folder (to create and destroy
the .ldb lockfile).
Also, you are creating a recordset in your code, but not using it for
anything - you can get rid of it.
Also, you should .close anything that you .open
eg
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.open
...
objConn.close
Set objConn = nothing
HTH
Cheers
Ken
> ----Original Message-----
> From: Hung Luc [mailto:hungmail@m...]
> Sent: 18 August 2000 02:26
> To: philp@w...
> Subject: Questions on ASP
>
>
> I have recently bought a book called 'Beginning ASP Database' by
> John Kauffman. After getting the write permission on my NT Server, and
> when I tried to add/insert a new record into my MS Access *.mdb files. It
> seems that it can't write to the database. It shows the error message as
> follows.
>
> Microsoft OLE DB Provider for ODBC Drivers error '80004005'
>
> [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable
> query.
>
> /dsnupdat.asp, line 14
>
> And here is my codes:
>
> <%
> ' Open MS Access DB with DSN-LESS Method
>
> Dim oCon, oRS
>
> Set oCon = Server.CreateObject("ADODB.Connection")
> Set oRS = Server.CreateObject("ADODB.Recordset")
>
> oCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
> Server.MapPath("db/petition.mdb")
>
> sqlquery = "INSERT INTO MyTable (FirstName,LastName) " &_
> "values('John','Smith')"
> oCon.Execute(sqlquery)
>
> Set oCon = Nothing
> Set oRS = Nothing
> %>
>
> It would be greate if you can help me to solve this problem.
>
> Thank you very much for your help.
>
> Hung
> hungmail@m...
>
|
|
 |