|
|
 |
Re: FN-FORUM Access SQL Error
date posted 31st January 2001 11:50
I'd normally use
conn.Execute "insert into Countries (ID, CountryGroupID, Name) Values
(1, 1, 'USA');"
To update using a recordset, just create the record set the use
RecordsetName.Addnew
RecordsetName("id") = 1
RecordsetName("CountryGroupID") = 1
RecordsetName("Name") = "USA"
RecordsetName.Update
Hope this helps
John Mawer
Mark Williams wrote:
>
> Anybody got any idea what this means...
>
> Microsoft OLE DB Provider for ODBC Drivers error '80004005'
> [Microsoft][ODBC Microsoft Access Driver] Operation must use an
> updateable query.
>
> This is the result I am getting from a standard INSERT SQL query from an
> ASP page - I have other databases on the same host, using the same code,
> and they work fine. Could this be something to do with the configuration
> of the database? This is really puzzling me...
>
> All fields in the INSERT query exist in the table that I am inserting
> into - I am specifying all of the fields, and the table definitely
> exists. All data is in the correct format - I cannot see what I can
> possibly be doing wrong. SELECT queries work fine, so I definitely have
> a valid database connection. All permissions are turned on in Access, so
> it's not a question of not being allowed write access to the table. The
> table I am trying to insert into is empty, so there is definitely no
> chance of duplicate records.
>
> If it helps, here is the code that produces the above error:-
> ' Test Database
> Set conn = Server.CreateObject("adodb.connection")
> conn.Open "ShoppingCart", "myusername", "mypassword"
> conn.Execute "insert into Countries (ID, CountryGroupID, Name) select
> 1, 1, 'USA';"
> conn.Close
> Well, this seems pretty perfect to me...
>
> Although I know what the notion of an updatable query is in Access, I
> was not aware that the fact that the query was updatable had to be
> specified from within ASP, nor indeed how to specify that. So I am truly
> stuck.
>
> Any help greatly appreciated.
>
> Mark
>
> ============================================================
>
> * Free listing for freelancers
> * Free to advertise jobs
> * Free jobs distribution service
> * Free database of 1000 freelancers
>
> Freelancers and Freelance Jobs
> http://www.freelancers.net
>
> To post to the Forum:
> [EMAIL REMOVED]
>
> To unsubscribe please email:
> [EMAIL REMOVED]
>
> If you have difficulties unsubscribing please email:
> [EMAIL REMOVED]
>
> To subscribe to the digest for this list or for further information please visit:
> http://www.freelancers.net/forum.html
|
 |
|