Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert and Update Records

Status
Not open for further replies.

Aaron36

Technical User
Mar 15, 2002
33
US
Hello,
I seem to have a problem with writing to or updating my databse. Using the Ultradev behaviors, I built an update page and an insert record page. Both of which work on my local system. On my local system I'm running PWS and an Access 2000 database. On my remote site I'm using the same database. Also the connections are the same as all the other pages on the site. I'm able to view the records but when I hit update "This page can't be displayed".
The setting on the database enable me to read and write and it's the same database that I uploaded to the server. Any Ideas? I'm stumped.
Also If I make the modifications to my Database on my local sytem and just upload it to the server, should that cause asp problems. It seems that when I just make the changes locally and then upload the database, sometimes the whole server crashes. Could that be because someone else is on the site while I upload, or does uploading a database to overwite the existing one cause problems? Another Idea I had was to remve the connection scripts prior to uploading which I thought might prevent some problems. Any Ideas?

Thanks for any help,

A. Davis
 
Uploading - as long as it is uploaded fully will by itself cause zero problems. If your uploading a 98 database onto a server that can only take 2000 and up you will run into some odd things.

Are you using DSN or DSN-less?

Verify you CAN show records okay, just an insert or update problem correct? "Insert witty remark here"

Stuart
 
I'm using an access 2000 database, the same one is on the server and my local system. I'm using a dsn connection, the same one that all my other pages use and work fine. I can vew the records but not update or insert. I have read and write permissions on the database on my local system and it's the same one on the server so I don't think that's a problem.
It would be easier to just make the changes locally and then upload but after crashing my server last week from doing that, I need another way. Any Ideas?
 
ok, so it's a code problem then most likely,

First open internet explorer, then goto tools, Internet options and then advanced.

On the one that says "Show friendly http error messages"

Uncheck that.

Then try to insert or update a record again, and let me know the detailed error message.
"Insert witty remark here"

Stuart
 
Ok I tried it and got this message:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.

/insert_image.asp, line 90

I did try the page on my local system and it worked fine, the problem was when I loaded it on the server.

Thanks
 
Copy about 10 lines above and below line 90,

paste them here.

And what are the field names for your database table? "Insert witty remark here"

Stuart
 
<%
' *** Insert Record: construct a sql insert statement and execute it

If (CStr(Request(&quot;MM_insert&quot;)) <> &quot;&quot;) Then

' create the sql insert statement
MM_tableValues = &quot;&quot;
MM_dbValues = &quot;&quot;
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
FormVal = MM_fields(i+1)
MM_typeArray = Split(MM_columns(i+1),&quot;,&quot;)
Delim = MM_typeArray(0)
If (Delim = &quot;none&quot;) Then Delim = &quot;&quot;
AltVal = MM_typeArray(1)
If (AltVal = &quot;none&quot;) Then AltVal = &quot;&quot;
EmptyVal = MM_typeArray(2)
If (EmptyVal = &quot;none&quot;) Then EmptyVal = &quot;&quot;
If (FormVal = &quot;&quot;) Then
FormVal = EmptyVal
Else
If (AltVal <> &quot;&quot;) Then
FormVal = AltVal
ElseIf (Delim = &quot;'&quot;) Then ' escape quotes
FormVal = &quot;'&quot; & Replace(FormVal,&quot;'&quot;,&quot;''&quot;) & &quot;'&quot;
Else
FormVal = Delim + FormVal + Delim
End If
End If
If (i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & &quot;,&quot;
MM_dbValues = MM_dbValues & &quot;,&quot;
End if
MM_tableValues = MM_tableValues & MM_columns(i)
MM_dbValues = MM_dbValues & FormVal
Next
MM_editQuery = &quot;insert into &quot; & MM_editTable & &quot; (&quot; & MM_tableValues & &quot;) values (&quot; & MM_dbValues & &quot;)&quot;

If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject(&quot;ADODB.Command&quot;)
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
(Line 90) MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

If (MM_editRedirectUrl <> &quot;&quot;) Then
Response.Redirect(MM_editRedirectUrl)
End If
End If

End If
%>


The field names are &quot;ID&quot; &quot;Apartment_ID&quot; and &quot;Pictures&quot;
I copied the whole asp statement and wrote a note where line 90 is.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top