Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving Database
Message
From
08/03/2001 06:27:39
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00482889
Message ID:
00483067
Views:
10
>I have been developing an application on my hard drive and using the Database Relocation Wizard to move it out to the network. Whenever I then try to delete the tables that I have previously move to the network on one particular table I get an error which says it can not locate path. However after that I am able to delete it. Is there some way to move the database from my local drive to the network without using the relocation wizard.

**********************************
* Class for relocating DE cursors
**********************************

define class Utility4De as Custom

network_path=''
*or network_path='H:\YOURDATA\' if mapped etc.

procedure get_database
lparameters cDatabaseName
local cDatabaseName
return addbs(this.network_path) + cDatabaseName

procedure form_de
lparameters oDataEnvironment
local i,j,db_name,arr_obj(1)
=amembers(arr_obj,oDataEnvironment,2)
for i = 1 to alen(arr_obj)
j = oDataEnvironment.&arr_obj(i) .baseclass
if upper(alltrim(j)) = 'CURSOR'
db_name=justfname(allt(oDataEnvironment.&arr_obj(i) .database ))
oDataEnvironment.&arr_obj(i) .database=this.get_database(allt(db_name))
if !file(oDataEnvironment.&arr_obj(i) .database)
messagebox('['+oDataEnvironment.&arr_obj(i) .database+']'+chr(13)+;
'Not found Check your data')
endif
endif
endfor

enddefine


********************
* Usage:
********************
*Somwhere at app init

Public oUtility
oUtility=createobject('Utility4De')
oUtility.network_path='\\NETWORKMACHINE\YOURDATA\'
*or oUtility.network_path='H:\YOURDATA\' if mapped etc.

*ussage in de.BeforeOpenTables
oUtility.form_de(this)
*

***
Sorry code will come up little bit unreadable but you can apply beautify
feature in your code window to have it all right.

<\PR> What is correct to get it nice here?

What is Database Relocation Wizard?
Rgds+
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Previous
Reply
Map
View

Click here to load this message in the networking platform