Error in WidnowsXP IIS

Results 1 to 3 of 3

Thread: Error in WidnowsXP IIS

  1. #1
    Join Date
    Dec 1969

    Default Error in WidnowsXP IIS

    When i compile this sample code below in the XP OS, I got the error:<BR>Microsoft OLE DB Provider for ODBC Drivers (0x80004005)<BR>[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.<BR>/vietit/link/redir.asp, line 23<BR><BR>NOTE: It works ok in Windows2000 with IIS. Please help<BR>---------------------------------<BR>&#060;%@ LANGUAGE="VBSCRIPT"%&#062;<BR>&#060;%Response.Buff er = True%&#062;<BR>&#060;!-- #INCLUDE FILE="" --&#062;<BR>&#060;%<BR><BR> Dim linkRec<BR> Dim link<BR> Dim hits<BR> Dim newUrl<BR> Set objConn = Server.CreateObject ("ADODB.Connection")<BR> Set linkRec = Server.CreateObject ("ADODB.Recordset") <BR><BR> &#039;get current link<BR> link = request.querystring("link")<BR> link = cint(link)<BR><BR> &#039;Open database <BR> objConn.Open strConnect<BR> Set linkRec = objConn.Execute ("SELECT * FROM links WHERE linkid = " & link & ";")<BR><BR> newUrl = linkRec("url")<BR><BR> objConn.Execute "UPDATE links SET links.hits = links.hits + 1 WHERE linkid = " & link<BR> <BR> Set linkRec = Nothing<BR> objConn.Close<BR> Set objConn = Nothing<BR><BR> response.redirect newUrl<BR><BR>%&#062;<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default ASPFAQS

    check the FAQS (upper right corner of this screen). It&#039;s covered in there.<BR>~~Chaotix

  3. #3
    Join Date
    Dec 1969

    Default RE: Error in WidnowsXP IIS

    Unless you set the .LockType property of the recordset object, you&#039;ll get back a read-only resultset. The default value for this property is adLockReadOnly, which does exactly that. Insert the following line right after you create the recordset object...<BR><BR>linkRec.LockType = adLockOptimistic <BR><BR>Everything else is unchanged. BTW, you&#039;ll need to #INCLUDE the ADOVBS.INC file in order to reference the ADO constants, or in this instance, just set the .LockType to 3.<BR><BR>One other thing, close your recordset object first then release it. Exactly like what you&#039;re doing with the connection object. <BR><BR>HTH<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts