Text fields failing to update? Know any querks?

  • Hi there,

    Hopefully this question is being ask of the right group. Although the beginning sounds like SQL2000 item...please read about the UPDATE question...

    Background: I am doing ASP pages and SQL2000. I am totally successful in retrieving, updating and adding records. However...I was in total need of having larger fields so instead of using VARCHAR it was suggested to use the text field type. Well this is cool and it works as far as adding a new record and retrieving the data. The PROBLEM is it will not allow me to update. It totally hangs up with a server time out.

    When I first worked on this text field type solution there was a stupid quirk in SQL about putting all text fields at the end or it won't work. Therefore I'm wondering if there is a similar querk in using the Update command verses something else when updating the record? Anyone know?

  • How are you doing the update? ADO? Stored Proc? T-SQL?

    Andy

  • Ah Sorry...Here's what the code looks like...that would have been helpful huh?

  • Ah Sorry...

    Fat fingered the Enter key =:|

    Here's what the code looks like...that would have been helpful huh?

    <%Server.ScriptTimeout= 320%>

    <link rel="stylesheet" href="../_css/COG1.css" type="text/css">

    Dim DataConnection, cmdDC, RecordSet

    Dim RecordToEdit, Updated,Done

    Set DataConnection = Server.CreateObject("ADODB.Connection")

    DataConnection.Open "DSN=DeptLevel"

    Set cmdDC = Server.CreateObject("ADODB.Command")

    cmdDC.ActiveConnection = DataConnection

    '-- default SQL

    SQL = "SELECT * FROM tblPage"

    If Request.QueryString("ID") <> "" Then

    RecordToEdit = Request.QueryString("ID")

    SQL = "SELECT tblPage.PageID, tblPage.* FROM tblPage WHERE (((tblPage.PageID)=" & Request.QueryString("ID") & "));"

    End If

    cmdDC.CommandText = SQL

    Set RecordSet = Server.CreateObject("ADODB.Recordset")

    RecordSet.Open cmdDC, , 0, 2

    If Request.Form("btnUpdate") = "Update" Then

    RecordSet.Fields("PageTitle") = Request.Form("PageTitle")

    RecordSet.Fields("body1") = Request.Form("body1")

    RecordSet.Update

    Updated = "True"

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply