Using the EXISTS statement in ASP

Results 1 to 3 of 3

Thread: Using the EXISTS statement in ASP

  1. #1
    Dan Davis Guest

    Default Using the EXISTS statement in ASP

    I am trying to find out if a table contains a certain column before i use the UPDATE statement. I was told that I should use the EXISTS statement. Does anyone have any ideas / examples of how to use this in asp ?

  2. #2
    Eddie Campbell Guest

    Default RE: Using the EXISTS statement in ASP

    This should do the job for you.<BR>&#060;%<BR>FieldExists = False<BR>Set Conn = Server.CreateObject("ADODB.Connection")<BR>Conn.Op en "DCR"<BR>Cmd = "Select * From TblStaff"<BR>set Myrs = Server.CreateObject("ADODB.Recordset")<BR>Myrs.Ope n cmd, Conn, 3<BR>For X = 0 To MyRs.Fields.Count -1<BR> If MyRs.Fields(X).name = "IntStaffId" Then<BR> FieldExists = True<BR> End if<BR> Response.write MyRs.Fields(X).name & "<BR>"<BR>Next<BR>Response.Write "The field exists = " & FieldExists<BR>%&#062;<BR>

  3. #3
    Join Date
    Dec 1969

    Default EXISTS is not standard SQL...

    ...and is not supported by (for example) Access.<BR><BR>So Eddie Campbell&#039s way is a better idea for a universal solution.<BR><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