Having problems with MS SQL

Results 1 to 2 of 2

Thread: Having problems with MS SQL

  1. #1
    Marcel Vogel Guest

    Default Having problems with MS SQL

    Hi,<BR><BR>I have a BIG problem with my MS SQL server.<BR>Sometimes the database gives back 3 records when there are 10 in the database the other time it gives back 6 records and another time it gives back all 10.<BR>Anyone know what the problem can be.<BR><BR>Here is the code I use to get the records:<BR><BR>&#060;%<BR>Dim objCon, objRec, strSQL<BR>Set objCon = Server.CreateObject("ADODB.Connection")<BR>Set objRec = Server.CreateObject("ADODB.RecordSet")<BR>objRec.L ockType = 1<BR>objRec.CursorType = 0<BR>objCon.Open = "Provider=SQLOLEDB; Data Source=xxx; Initial Catalog=xxx; User ID=xxx; Password=xxxx"<BR>strSQL = "SELECT PersberichtID, Title FROM PersBerichten WHERE DatumAktief &#060; &#039" & Date + 1 & "&#039"<BR>Set objRec = objCon.Execute(strSQL)<BR><BR>teller = 1<BR>While Not objRec.EOF<BR>Response.Write "&#060;a href=&#039default.asp?id=" & objRec("PersberichtID") & "&#039&#062;" & teller & "&#060;/a&#062;<BR>" & vbcrlf<BR>teller = teller + 1<BR>objRec.MoveNext<BR>Wend<BR><BR>objRec.Close<B R>Set objRec = Nothing<BR>objCon.Close<BR>Set objCon = Nothing<BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Having problems with MS SQL

    Could it be the DatumAktief is a datetime field. If so, you could append the time on the end of the search criteria - such as 11:59 PM or 12:00 AM.<BR><BR>HTH<BR><BR>Jerry

Posting Permissions

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