How to access store method from database context

Good Morning

I have a Basic function to connect to various embedded databases:

Private Function getFBConnection(context$)
Dim DatabaseContext As Object
Dim DataSource As object
	DatabaseContext = createUnoService("com.sun.star.sdb.DatabaseContext")
	DataSource = DatabaseContext.getByName(context)
	getFBConnection= DataSource.getConnection("","")
End Function

one of the issues that i have with this is that despite the fact that i can insert data, and there are no errors, and even after i make a commit, the data is not saved. i normally handle this by using ThisDatabaseDocument.store() when the code is embedded in the odb file. However in the current instance, the code is not embedded. Is there a way to access store method from either the connection or the context (or any other way)? Thank you.

I found a solution:

	DataSource.DatabaseDocument.Store()	

DataSource should not be declared within the getFBConnection Function that I declared. It should be declared outside of the Function with in the module.