Phil Chapman
asked on
DBCC DBREINDEX and VB6
When you run
DBCC DBREINDEX ('pubs.dbo.authors', UPKCL_auidind, 0)
In Enterprise Manager you get the following results
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
QUESTION:
How do you run a query in VB to return the above results
SQL= "DBCC DBREINDEX ('pubs.dbo.authors', UPKCL_auidind, 0)"
conn.Execute SQL, lRet
' Returns a -1
rs.Open SQL, conn, adOpenForwardOnly, adLockReadOnly
' Does not return anything
DBCC DBREINDEX ('pubs.dbo.authors', UPKCL_auidind, 0)
In Enterprise Manager you get the following results
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
QUESTION:
How do you run a query in VB to return the above results
SQL= "DBCC DBREINDEX ('pubs.dbo.authors', UPKCL_auidind, 0)"
conn.Execute SQL, lRet
' Returns a -1
rs.Open SQL, conn, adOpenForwardOnly, adLockReadOnly
' Does not return anything
ASKER
adding WITH TABLERESULTS to the query does not return anything when
rs.Open SQL, conn, adOpenForwardOnly, adLockReadOnly
is run
rs.Open SQL, conn, adOpenForwardOnly, adLockReadOnly
is run
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SQL= "DBCC DBREINDEX ('pubs.dbo.authors', UPKCL_auidind, 0) WITH TABLERESULTS "
rs.Open SQL, conn, adOpenForwardOnly, adLockReadOnly