Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Safe Database Open Code
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Safe Database Open Code
Miscellaneous
Thread ID:
00643293
Message ID:
00643293
Views:
39
This isn't quite working. What I am trying to do (and without the macro expansion if I can help it) is open the database if it is not already open, and if it is already open then close-reopen it with the appropriate parameters. The problem is that it is not closing and re-opening.
	*	Database Open
		Function DOpen
		Lparameters cDBCPath,cDBCParms
			Local aDBCs
			Dimension aDBCs[1]
			If ADatabases(aDBCs)=0
				Open Database ( cDBCPath ) &cDBCParms
				Return .t.
			EndIf
			iPos = ASCAN(aDBCs, JustFname(cDBCPath) )
			If iPos <> 0
				Set Database To ( cDBCPath )
				Close Databases
				Open Database ( cDBCPath ) &cDBCParms
			Else
				Set Database To
				Open Database ( cDBCPath ) &cDBCParms
				Set Database To ( JustStem( JustFname(cDBCPath) ) )
			EndIf
		Return .t.
		EndFunc
...open("e:\database.dbc","shared noupdate")
I cannot create a table
...open("e:\database.dbc","shared")
I still cannot create a table
Next
Reply
Map
View

Click here to load this message in the networking platform