Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Close form and sqlite
#1
Hello,

1/ What is best way for show différent form in intraweb ?
2/ What i must close when i use sqlite, when i close webbrower ?

3/ My problem nos is when i close bowser
and i restart a new session no error but no showing dat of my database

any idea ?

Thank's a lot
best regards
Reply
#2
1) There are numerous demos in our demo repository which show how to do this.

2) It depends on your database usage, but in most cases the connection is closed when the session expires. Again there are DB demos in our repository.

3) This is managed for you by IntraWeb via the user session.
Reply
#3
>1/ What is best way for show différent form in intraweb ?

If you are using latest IW 15.2.x you can use:

Code:
WebApplication.ShowForm(TForm1)

It receives 3 parameters:

ShowForm(AFormClass: TComponentClass; AReleaseActiveForm: Boolean = False; AUseExistingInstance: Boolean = False): TComponent;

AFormClass: The class of the form you want to show (e.g. TForm1)
AReleaseActiveForm: True if you want the current active form to be destroyed when the new one becomes the active. In general, I'd suggest to set this to true, unless you intend to go back to this form later and want to keep its state.
AUseExistingInstance: Default is false. You can set to true if you already have an instance of this form, in the same session, and you want to make it the active form again

If you are using older version, you can create/show it like:

Code:
TForm1.Create(WebApplication).Show;

>2/ What i must close when i use sqlite, when i close webbrower ?

You don't need to do anything. All DB connections will be closed when the session expires (and the UserSession/Forms/DataModules are all destroyed).

>3/ My problem nos is when i close bowser
>and i restart a new session no error but no showing dat of my database

Where are you opening the dataset? Maybe you can try OnRender event of the form. In the OnRender, if the dataset is not active you can open it. Just don't add any "heavy" repetitive processing in the OnRender event, because it can happen several times during the form life cycle.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)