Forums
This topic is locked
It will just not work!!!!
Posted 06 Oct 2002 09:37:07
1
has voted
06 Oct 2002 09:37:07 Magnus Magnus posted:
Hey again!!!I have looked and searsh all night but i can not find the answer to my problem.
It is that when i try to insert a record inte my db i get the errormessage>>>>
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][Drivrutin för ODBC Microsoft Access]
Operation must use an updateable query.
I was thinking that the reason was in my connection how doesent work either befor.
But "djvgalen" was helping me with that, but i still can get the insert record to work.
I run IIS 5.1 and usa access 2002, i have full premison (read/write).
I have try to change corser and locktype in the recordset.
When i already are going to post this message i can throw in another question aswell.
How do i write the cod so i can get a form to be sent automaticly on "OnLoad"?
I will say thanks for a great site and a fantastic support....
Thank you guys!!!!!
Replies
Replied 10 Oct 2002 20:47:23
10 Oct 2002 20:47:23 Ned Frankly replied:
It sounds like you are trying to do a table UPDATE referencing a table that you opened as a recordset without a WHERE clause (or a WHERE clause that returns more than one row). Make sure that you are doing an INSERT into the table. If your need is actually an UPDATE make sure that your recordset only returns one row when you issue the query.
-OR-
If you are trying to do the INSERT code on your own (without using the DMX INSERT RECORD behavior) you probably have specified the wrong Object. UPDATE and INSERT uses this:
Server.CreateObject('ADODB.Command');
Where a Recordset uses this:
Server.CreateObject("ADODB.Recordset"
;
If this does not help you, post the ASP portion of your page so we can look at it and figure out what's going on.
Ned Frankly
-OR-
If you are trying to do the INSERT code on your own (without using the DMX INSERT RECORD behavior) you probably have specified the wrong Object. UPDATE and INSERT uses this:
Server.CreateObject('ADODB.Command');
Where a Recordset uses this:
Server.CreateObject("ADODB.Recordset"

If this does not help you, post the ASP portion of your page so we can look at it and figure out what's going on.
Ned Frankly
Replied 12 Oct 2002 20:24:42
12 Oct 2002 20:24:42 Magnus Magnus replied:
Well i can not get it working so i paste the code. What i try to do is "insert record". I am confused i have done this alot of times in DW 4 and it have never been any problem....
Set rsKunder = Server.CreateObject("ADODB.Recordset"
rsKunder.ActiveConnection = MM_Kunder_STRING
rsKunder.Source = "SELECT * FROM Kunder"
rsKunder.CursorType = 0
rsKunder.CursorLocation = 2
rsKunder.LockType = 3
rsKunder.Open()
rsKunder_numRows = 0
Set rsKunder = Server.CreateObject("ADODB.Recordset"

rsKunder.ActiveConnection = MM_Kunder_STRING
rsKunder.Source = "SELECT * FROM Kunder"
rsKunder.CursorType = 0
rsKunder.CursorLocation = 2
rsKunder.LockType = 3
rsKunder.Open()
rsKunder_numRows = 0