Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Force a Copy of my Database
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

miker2
Starting Member

United Kingdom
12 Posts

Posted - 18 September 2004 :  05:40:32  Show Profile
Hi all

I have a problen in that my forum host has moved my account directories from their D: drive to their F: drive.

The forum config.asp database pointer still looks at the D: drive.
ie. strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\freehost\myforum\cgi-bin\smg_resident.mdb" '## MS

Access 2000

I have tried to copy the DB file using Server.CreateObject("Scripting.FileSystemObject") but this only goes to the

account root, not the drive root.

Can anyone supply a code snippet which I can add to the forum code to force a copy of the DB file to the new drive as I

currently cannot create a backup copy to my PC.

I would only need to run this one time, then I can reset the config.asp to point to the new drive.

The host's member login function is currently not operational, so I cannot get in that way.

I hope someone can help here, it is rather urgent.

Regards

Mike

Mike

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 18 September 2004 :  05:53:42  Show Profile  Visit Gremlin's Homepage
I'm a little confused as to exactly what your trying to do, but I have to ask why didn't the host copy the DB along with the rest of the site? .. personally I'd say get your host to fix what they broke, as a customer shouldn't have to fix their mistakes, the filesystemobject can access files outside your account root, but most likely you'll not have sufficient permissions to do anything anyway.


Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page

miker2
Starting Member

United Kingdom
12 Posts

Posted - 18 September 2004 :  06:03:30  Show Profile
Like I said, I can't access the host's member login to contact their tech support. I have emailed the webmaster 2 days ago - no reply.

I'm stuck, hence to request for help to try to do it through forum code. As the code knows where the DB is and can read it, I want it copied to the drive my FTP accesses.

This is WebSamba I talking about.

Mike

Mike
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 18 September 2004 :  07:04:33  Show Profile
I know it doesn't help now, but this is exactly why I don't like hard-coding drive paths in your config.asp. Also, there is nothing to say that their D drive even exists any more.

Sorry, I know I'm not helping, but I can't see a solution without getting in touch with the hoster
Go to Top of Page

miker2
Starting Member

United Kingdom
12 Posts

Posted - 18 September 2004 :  07:38:26  Show Profile
Yes, their D drive still exists because my DB is on it. When I started the forum, I used WHEREAMI.ASP as instructed, then used the drive info given to put in my config.asp. The hoster then moved the account,unnoticed by me, in late July. This included the DB which contains members and posts up to that date. The forum is ongoing and contains new members and posts since July, and this is still on the D drive.

As I can't contact the hoster, and I have no way of access to the D drive via FTP, I'm stuck.

When I can recover the current DB and move it to F drive, I can then change the config.asp to point to the new DB position.

Thanks for your help so far, but is it possible to insert a code snippet into one of the forum files to force the DB to copy itself from existing directory to the F drive. I just need a current copy so as not to lose the current members/posts.

Another thought would be to get the forum to email me a copy of the DB. I'm grasping at straws here.

Mike

Mike
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 18 September 2004 :  08:22:12  Show Profile
AH I get it this time I think .... you can still access the db, it's just not in your account area.

Even Table Editor won't do it for you
Go to Top of Page

miker2
Starting Member

United Kingdom
12 Posts

Posted - 18 September 2004 :  08:28:30  Show Profile
Correct

I was hoping some added asp code could create a copy of the DB into my user account area directory.

Mike

Mike
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 18 September 2004 :  09:03:28  Show Profile
Actually Table Editor does have some code that would help. It has a backup feature that you can alter the backup feature and alter it to move to your location.

I think the important part for you is :


	Sub RenameFile(sFrom, sTo)
	   Dim fso, f
	   Set fso = CreateObject("Scripting.FileSystemObject")
	   sDateTimeStamp = "." & year(now) & LeadingZero(month(now),2) & LeadingZero(day(now),2) & "-" & LeadingZero(hour(now),2) & LeadingZero(minute(now),2) & LeadingZero(second(now),2)
	   If not bOnlyBackup Then
			fso.MoveFile sTo, Server.MapPath(ShortFileName & sDateTimeStamp & ".bak")
			fso.MoveFile sFrom, sTo
	   Else
			fso.CopyFile sTo, sTo & sDateTimeStamp & ".bak"
	   End If
	End Sub

Go to Top of Page

miker2
Starting Member

United Kingdom
12 Posts

Posted - 18 September 2004 :  09:29:42  Show Profile
I downloaded an asp version of table editor from www.codeproject.com, but could not find what you were referring to. I could not see a backup facility.

Could you send me your version code, or a URL where I can get the same version.

Thanks.

Mike

Mike
Go to Top of Page

miker2
Starting Member

United Kingdom
12 Posts

Posted - 18 September 2004 :  10:13:02  Show Profile
I made an asp file with the code snippet in as follows:

<%
Dim fso, f,sDateTimeStamp
Dim sFrom,sTo
sFrom="d:\freehost\myforum\cgi-bin\smg_resident.mdb"
sTo="f:\freehost\myforum\cgi-bin\smg_resident"

Set fso = CreateObject("Scripting.FileSystemObject")
sDateTimeStamp = "." & year(now) & LeadingZero(month(now),2) & LeadingZero(day(now),2) & "-" & LeadingZero(hour(now),2) & LeadingZero(minute(now),2) & LeadingZero(second(now),2)


fso.CopyFile sFrom, sTo & sDateTimeStamp & ".bak"

%>

but I got the error:

Microsoft VBScript runtime error '800a01ad'

ActiveX component can't create object: 'Scripting.FileSystemObject'

/smgforum/forum/db_copy2.asp, line 7

which is what I got from a previous attempt.
It looks like I can only access my user account directories with the FileSystemObject, yet the forum can see the DB on the D drive.


Mike

Mike
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 18 September 2004 :  19:58:21  Show Profile  Visit Gremlin's Homepage
Actually to me that seems to be indicating that FSO isn't available on the server.

Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 18 September 2004 :  22:11:09  Show Profile
Ditto, it sounds like WebSamba doesn't even allow FSO's at all ... and that's the only way to do it I can think of
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 18 September 2004 :  23:00:16  Show Profile
http://www.2enetworx.com/dev/projects/tableeditor.asp if it helps
Go to Top of Page

miker2
Starting Member

United Kingdom
12 Posts

Posted - 21 September 2004 :  05:33:44  Show Profile
Hi Laser

Many thanks for you help.

I think you are right about the FSO on WebSamba.

I found in the forum "Compress Database" routine where it backs up the database before compressing.

I found I could not compress the database due to a failure of the FSO.

Over the weekend, WebSamba went crazy, I could not access my forum at all, so I have had to abandon it (sadly).

Fortunately, I managed to make screen copies (into Word) of all the lost posts and also got a list of members email addresses, so then manually re-entered the posts on a new forum location and emailed all members they would have to log in again.

So all was not lost.

WebSamba seems to have been overloaded, or some such problem. I don't know if it's due to the incliment weather in the south of the USA or other reasons. They seem to be keeping quiet and appear uncontactable.

Thanks again, also for the Table Editor URL

Regards

Mike





Mike
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.47 seconds. Powered By: Snitz Forums 2000 Version 3.4.07