HeLp! Database Connection Error

Results 1 to 2 of 2

Thread: HeLp! Database Connection Error

  1. #1
    Join Date
    Dec 1969

    Default HeLp! Database Connection Error

    ADODB.Recordset error &#039 800a0bb9&#039 <BR><BR>The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. <BR><BR>/PV1_0/inc/hits.asp, line 22 <BR><BR>My file::::<BR>&#060;%=RetrieveAndIncrementCount()%&# 062;<BR>&#060;%<BR>Function RetrieveAndIncrementCount()<BR> &#039 From<BR> Const adOpenKeyset = 1<BR> Const adLockPessimistic = 2<BR> Const adCmdText = &H0001<BR><BR> &#039 Local variables<BR> Dim strFilename<BR> Dim strSQL<BR> Dim rsCounter<BR> Dim iCount<BR> Dim connhits<BR><BR> Set connhits = Server.CreateObject("ADODB.Connection")<BR> "Album"<BR><BR> strFilename = Request.ServerVariables("SCRIPT_NAME")<BR> strSQL = "SELECT * FROM hits WHERE pagename=&#039" & strFilename & "&#039 "<BR> Set rsCounter = Server.CreateObject("ADODB.Recordset")<BR> rsCounter.Open connhits, strSQL, adOpenKeyset, adLockPessimistic, adCmdText<BR><BR> If rsCounter.EOF Then<BR><BR> rsCounter.AddNew<BR><BR> iCount = 0<BR><BR> rsCounter.Fields("pagename").Value = strFilename<BR> Else<BR> rsCounter.MoveFirst<BR><BR> iCount = rsCounter.Fields("hitcount").Value<BR> End If<BR><BR> rsCounter.Fields("hitcount").Value = iCount + 1<BR> rsCounter.Update<BR><BR> rsCounter.Close<BR> connhits.Close<BR> Set rsCounter = Nothing<BR> Set connhits = Nothing<BR><BR> RetrieveAndIncrementCount = iCount<BR>End Function<BR>%&#062;<BR><BR>Hope someone can help me on my last part of my new website~

  2. #2
    olivier Guest

    Default RE: HeLp! Database Connection Error

    Your sqlstring and connection are switched<BR>replace following line:<BR>rsCounter.Open connhits, strSQL, adOpenKeyset, adLockPessimistic, adCmdText<BR>with:<BR>rsCounter.Open strSQL, connhits, adOpenKeyset, adLockPessimistic, adCmdText

Posting Permissions

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