Link to home
Start Free TrialLog in
Avatar of Phil Chapman
Phil ChapmanFlag for United States of America

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




Avatar of Nightman
Nightman
Flag of Australia image

I'm not sure about the return value, but try this:

SQL= "DBCC DBREINDEX ('pubs.dbo.authors', UPKCL_auidind, 0) WITH TABLERESULTS "
rs.Open SQL, conn, adOpenForwardOnly, adLockReadOnly

Avatar of Phil Chapman

ASKER

adding WITH TABLERESULTS  to the query does not return anything when
rs.Open SQL, conn, adOpenForwardOnly, adLockReadOnly
is run
ASKER CERTIFIED SOLUTION
Avatar of Nightman
Nightman
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial