LPARAMETERS strDBName, strDBPath, strDBType LOCAL strDBNameShort, intLength WITH thisform * test for a data path IF EMPTY(strDBType) OR VARTYPE(strDBType) <> "C" THEN && no database type passed RETURN -5 ENDIF IF EMPTY(strDBPath) OR VARTYPE(strDBPAth) <> "C" THEN RETURN -1 && no path ELSE strDBPath = ADDBS(strDBPath) .pdatapath = strDBPath SET DEFAULT TO "&strDBPath" && get into the data folder ENDIF * test what type of database we are working with DO CASE CASE ALLTRIM(UPPER(strDBType)) == "VFP" * test for a valid database name IF EMPTY(strDBName) OR VARTYPE(strDBName) <> "C" THEN RETURN -2 && no database name ELSE IF ".DBC" $ UPPER(strDBName) THEN && check it's a valid database name intLength = LEN(strDBName) strDBNameShort = SUBSTR(strDBName, 1, (intLength - 4)) IF FILE(strDBPath + strDBName) THEN && database exists - open it IF NOT DBUSED("'" + strDBName + "'") THEN OPEN DATABASE (strDBName) SHARED ENDIF SET DATABASE TO (strDBNameShort) .msetdataenvironment() .mopentables(strDBPath) RETURN 1 ELSE RETURN -4 && database does not exist ENDIF ELSE RETURN -3 && invalid database name ENDIF ENDIF CASE ALLTRIM(UPPER(strDBType)) == "ACC" CASE ALLTRIM(UPPER(strDBType)) == "MSDE" CASE ALLTRIM(UPPER(strDBType)) == "SQL" OTHERWISE RETURN -6 && invalid database type passed ENDCASE ENDWITHthis is in msetdataenvironment
SET DATE BRITISH SET TALK OFF SET CENTURY ON SET EXCLUSIVE OFF SET MULTILOCKS ON SET EXACT ON SET DELETED ON RETURN .T.and this is in mopentables
LPARAMETERS strDBPath * open tables for this object IF !USED('sysoptions') THEN USE (strDBPath + "sysoptions") IN 0 ALIAS sysoptions SHARED ENDIF SELECT sysoptions CURSORSETPROP("Buffering", 5, "sysoptions") && set optimistic row buffering on LOCATE thisform.pMainTable = "sysoptions" RETURN .t.I would try opening the database and tables in the LOAD but I am not sure how to pass to the INIT of the form the info it needs ie: path to the database and table name to open. This is how I am instansiating the object in VB...
Dim oHub As New datahub.dhsys
If I try and add anything to end of this statement I get "End of statement expected"