Create a Table from ASP

Results 1 to 2 of 2

Thread: Create a Table from ASP

  1. #1
    Join Date
    Dec 1969

    Default Create a Table from ASP

    I am creating a table with just one column in ASP. The database here is SQL Server and I am using ADO object. My question is, before creating the table I have to verify if the object (table) already exist in the database. How do I do that. <BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default Verifying if table exists

    How about this:<BR><BR>&#060;%<BR>...<BR>Set RS = Server.CreateObject("ADODB.RecordSet")<BR>On Error Resume Next<BR>RS.Open "tablename", yourConnection<BR>On Error GoTo 0<BR>If RS.state = adStateOpen Then<BR>&nbsp; &nbsp; RS.Close<BR>&nbsp; &nbsp; ... the table exists already ...<BR>Else<BR>&nbsp; &nbsp; ... the table does not exist ...<BR>End If<BR>...<BR>%&#062;<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