Results 1 to 2 of 2

Thread: i'm on vb6 and access database check if table exixts

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,586

    i'm on vb6 and access database check if table exixts

    My experiment...

    how to set a variable string in this code, instead a fixed name of table?:

    ...
    Dim TABELLA as String

    TABELLA ="NUOVATABELLA"

    ....
    Code:
    Dim RSSCHEMA As ADODB.Recordset
    
        Set RSSCHEMA = _
            CON.OpenSchema(adSchemaColumns, Array(Empty, Empty, " & TABELLA & ", Empty))
            
        If RSSCHEMA.BOF And RSSCHEMA.EOF Then
            MsgBox "Table does not exist"
        Else
            MsgBox "Table exists"
        End If
        
        RSSCHEMA.Close
        Set RSSCHEMA = Nothing

  2. #2
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,398

    Re: i'm on vb6 and access database check if table exixts

    Have you tried something like this:

    Code:
    Dim strTableName As String
    
    Dim RSSCHEMA As ADODB.Recordset
    
        Set RSSCHEMA = CON.OpenSchema(adSchemaColumns, Array(Empty, Empty, strTableName, Empty))

Posting Permissions

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



Click Here to Expand Forum to Full Width