General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Mark,
After digging more on MSDN's site, found this (Article ID: Q128996). Replace the DATA_PATH with the path you want for your dbc.
* Paste this code into your form's DataEnvironment.BeforeOpenTables() method and it will switch the DBC's path to the local path...
DATA_PATH=FULLPATH('')
* Make a list of all the cursors in the Data Environment
AMEMBERS(A_Cursors,THISFORM.DATAENVIRONMENT,1)
ASORT(A_Cursors, 2)
nStartpos=ASUBSCRIPT(A_Cursors, ASCAN(A_Cursors, "Object"),1)
FOR I = nStartpos TO ALEN(A_Cursors,1)
IF A_Cursors(I,2) = "Object"
cObjClass = "THISFORM.DATAENVIRONMENT."+A_Cursors(I,1)+".class"
IF EVAL(cObjClass)="Cursor"
cObjName="THISFORM.DATAENVIRONMENT." ;
+ A_Cursors(I,1)+".DATABASE"
* Display the Object name...
*WAIT WINDOW cObjName
Data_Name=EVAL(cObjName)
* Display the Old Pathing
*WAIT WINDOW "This is Data_Name : "+ Data_Name
* Modify the path to the database
NewDataPath=ALLTRIM(DATA_PATH) ;
+ ALLTRIM(SUBSTR(Data_Name, RAT("\",Data_Name)+1))
* Display the New Pathing
*WAIT WINDOW NewDataPath
* Evaluate the cursor object
oRef = EVAL( "THISFORM.DATAENVIRONMENT."+A_Cursors(I,1) )
*Modify the Database property with the new path
oRef.DATABASE = NewDataPath
ENDIF
ELSE
EXIT
ENDIF
ENDFOR
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only