Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2006
    Posts
    8

    Unanswered: Query Checking...

    I want to check if a query returns a proper recordset or if is something wrong (a column not found, database not found e.t.c).

    I have the following setting fro my query :
    strSQL = "select something from table1"
    Set objRS = Server.CreateObject("ADODB.Recordset")
    objRS.Open strSQL, Conn

    How can check if the query is valid so to enter an IF statement so :
    If (query = False) Then
    Response.Write("There is wrong with the query!")
    Else

    ..... All the things i wanna do when the query is correct
    End If

    So not to have the annoying white screen message but a proper common user friendly message ???

  2. #2
    Join Date
    Jul 2004
    Posts
    23
    You should check Err.Number<>0

Posting Permissions

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