Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Shrinking an SQL datafile/logfile via ASP...

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-10-24 : 09:29:25
Andrew writes "Howdy Folks...

A dilemma for you...

I recently discovered that you can manually initiate an Access database to compact iteself via ASP using the code snippet:

Set jro = Server.CreateObject("jro.JetEngine")
If objFSO.FileExists("D:\webspace\datematc\db\" & GetFile(strDBSitebak)) Then objFSO.DeleteFile("D:\webspace\datematc\db\" & GetFile(strDBSitebak))

jro.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\webspace\datematc\db\" & GetFile(strDBSite),"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\webspace\datematc\db\" &GetFile(strDBSitebak) & ";Jet OLEDB:Engine Type=5"

I have sinced moved to SQL Server and I am wondering if I can do something similar with SQL Server. The trick here is that I don't have access to the server on which my database is stored (hosted by a hosting provider) - so I have to be able to shrink it on demand remotely!

Figure that one out!

Cheers blokes!

Andrew
Nevnet Productions"
   

- Advertisement -