Re: Only want to insert a record
- From: "Mark J. McGinty" <mmcginty@xxxxxxxxxxxxxxx>
- Date: Tue, 10 Jan 2006 21:40:07 -0800
"Daniel Crichton" <msnews@xxxxxxxxxxxxxxxxxx> wrote in message
news:eT9WjlgFGHA.984@xxxxxxxxxxxxxxxxxxxxxxx
>
> "Dave" <dave5398@xxxxxxxxxxxxxx> wrote in message
> news:el5ghQeFGHA.3700@xxxxxxxxxxxxxxxxxxxxxxx
>>
>> "Daniel Crichton" <msnews@xxxxxxxxxxxxxxxxxx> wrote in message
>> news:%23ULG0EeFGHA.2444@xxxxxxxxxxxxxxxxxxxxxxx
>>>
>>> "Dave" <dave5398@xxxxxxxxxxxxxx> wrote in message
>>> news:eOuM54dFGHA.3892@xxxxxxxxxxxxxxxxxxxxxxx
>>>> I'm trying again to develop my web application locally using IIS and
>>>> asp scripting with a local MS Access database. I have never managed to
>>>> update or insert a record using scripting. I can seem to display
>>>> records ok but any attempt to amend records seems to fail. I tried
>>>> using recordsets then read in MS documentation you should execute a
>>>> direct command. My latest failed attempt is this:
>>>>
>>>> ConnectionString = ".....etc"
>>>> Conn.Mode=3
>>>> Conn.Open(ConnectionString)
>>>> sql="INSERT INTO Users (Name, Password) VALUES ('Jim', 'Hello')"
>>>> Conn.Execute sql
>>>>
>>>> The sql works fine within Access itself. When executed within an asp
>>>> page however I get:
>>>>
>>>> Error Type:
>>>> Microsoft JET Database Engine (0x80004005)
>>>> Operation must use an updateable query.
>>>>
>>>> Can anyone please help, I've been trying for months.
>>>
>>> Do you have a primary key on that table? The error message suggests not.
>>> Also try adding [] around your table and column names - in some system
>>> Name and Password are reserved words, and ADO or the OLE DB driver may
>>> be trying to interpret them as such. Also drop the Mode property, I've
>>> never needed to use this myself as I believe the default is to not set
>>> any permissions, which lets you do whatever your user permissions allow.
>>>
>>> sql="INSERT INTO [Users] ([Name], [Password]) VALUES ('Jim', 'Hello')"
>>>
>>>
>>> Dan
>>
>> Dan,
>>
>> Thanks but still no look. I did all of the above and still get the same
>> result. Any reason why calling ADO from a script should be different to
>> calling it from MS Access or VB?
>>
>
> In Access the native parser is doing all the work. Via ADO it's being
> handled by the Jet engine via the OLE DB provider, so is not completely
> native. When you say "VB", how is that different from a script? Are you
> saying it's working using VB? What version of VB?
Possibly a permissions issue involving the "IUSR_*" (anonymous web user)?
Maybe that user context only has read-only permissions to the .mdb file?
Running a VB program (or VBA in Access) permissions are those of the
logged-in user; not so from within an ASP script.
So if you're attempting to access the web site anonymously, you'll need to
make sure the user account used for that anonymous context has sufficient
privileges to use that file (which will include file create in the parent
directory.)
That being said, a much better plan would be to migrate to SQL Server as
your DB back-end. Reasons:
1. Its 'lite' version costs nothing, just like Jet/Access
2. Its facility for concurrency is almost infinitely better than Jet's
3. If/when your site needs/justifies full-blown SQL Server, your code
will need no changes
(It will not circumvent IUSR security issues, it will merely change them
some.)
-Mark
> Dan
>
.
- Follow-Ups:
- Re: Only want to insert a record
- From: Dave
- Re: Only want to insert a record
- References:
- Only want to insert a record
- From: Dave
- Re: Only want to insert a record
- From: Daniel Crichton
- Re: Only want to insert a record
- From: Dave
- Re: Only want to insert a record
- From: Daniel Crichton
- Only want to insert a record
- Prev by Date: Re: The specified procedure could not be found
- Next by Date: Re: Timeout Expired
- Previous by thread: Re: Only want to insert a record
- Next by thread: Re: Only want to insert a record
- Index(es):
Relevant Pages
- Re: cant get access to disk share when connecting from a remote s
... The systems are DUTs. ... for each of the drives within the system. ...
Everything in the scripts work except the file permissions below the shares ... the shares
on the DUTs manually, after they run my rename script, but I would ... (microsoft.public.windows.server.scripting) - Re: VBA Script to Read WMP 11 Database
... The script failed on the desktop when I downloaded WMP11, ... Just reviewing
the bidding -- WMP 11 responds properly to commands in a VBS ... That's why the computer
wouldn't let me manually change the permissions. ... Digital Media MVP: 2004-2007
... (microsoft.public.windowsmedia) - Re: public role question
... Dan, I'm sorry but after I responded to Kalen's email I deleted the test ...
Somehow the user 'dantest' was the owner of the database so I guess ... I did create a
second user with only the public role for permissions and was ... Then I am able to create
a stored procedure. ... (microsoft.public.sqlserver.security) - Re: VBA Script to Read WMP 11 Database
... The script failed on the desktop when I downloaded WMP11, ... Just reviewing
the bidding -- WMP 11 responds properly to commands in a VBS ... That's why the computer
wouldn't let me manually change the permissions. ... The CREATOR OWNER is likely
on windows to be one of the admin accounts ... (microsoft.public.windowsmedia) - Re: how to restrict users to search in their own Organizational Unit
... will be given the necessary permissions. ... Who would you DENY? ...
decided a script can make it possible to accomplish, ... If I need to create a security
group per OU and then add all users ... (microsoft.public.windows.server.active_directory)