要是有这个表,就直接插入数据;要是还没有,就先建立该表再插入数据。
请教!

解决方案 »

  1.   

    select tablename from sysobjects where type=‘u’
      

  2.   

    select name from sysobjects where type=‘u’and name='tablename'
      

  3.   

    不能直接用一个建表的SQL语句来判断吗??如果有应该会有提示吧
      

  4.   

    以下使用ADOX
    Dim cat As New ADOX.Catalog
    Dim tblNew As New ADOX.Table
    cat.ActiveConnection = OleCnn '数据库连接对象
            With cat
                For Each tblNew In .Tables
                    If tblNew.Name = "MyTableName" Then
                        MsgBox "Find it"
                    End If
                Next tblNew
            End With