select * from sysobjects where OBJECTPROPERTY(id, N'IsUserTable') = 1 and uid = (SELECT USER_ID('用户名'))
以上代码基于 MSSQL Server
我用的是oracle数据库, 用户名是 convert 怎么写?
1.Use OpenSchema method of Connection Object can retieve the table name sample: List1.Clear Dim oConn As New ADODB.Connection, strConn As String, oRst As ADODB.Recordset Set oConn = New ADODB.Connection strConn = "Provider=sqloledb;" & _ "Data Source=ccc4;Initial Catalog=Pubs;User Id=sa;Password=; " oConn.Open strConn Set oRst = oConn.OpenSchema(adSchemaTables) Do While Not oRst.EOF If oRst!TABLE_TYPE = "TABLE" Then List1.AddItem oRst!TABLE_NAME oRst.MoveNext Loop Set oRst = Nothing Set oConn = Nothing 2.Use ADOX
where
OBJECTPROPERTY(id, N'IsUserTable') = 1
and uid = (SELECT USER_ID('用户名'))
用户名是 convert
怎么写?
sample:
List1.Clear
Dim oConn As New ADODB.Connection, strConn As String, oRst As ADODB.Recordset
Set oConn = New ADODB.Connection
strConn = "Provider=sqloledb;" & _
"Data Source=ccc4;Initial Catalog=Pubs;User Id=sa;Password=; "
oConn.Open strConn
Set oRst = oConn.OpenSchema(adSchemaTables)
Do While Not oRst.EOF
If oRst!TABLE_TYPE = "TABLE" Then List1.AddItem oRst!TABLE_NAME
oRst.MoveNext
Loop
Set oRst = Nothing
Set oConn = Nothing
2.Use ADOX
千万别忘了给分