![]() With the new property selected, go to the Inspector to set the name, type and scope using these values: Select the App object from the Navigator (the left panel in the Xojo IDE), choosing the Insert > Property option from the contextual menu. Now is time to create a new SQLiteDatabase instance and assign it to this property, so it will point to the SQLite database file when the app is running. ![]() Write the following code in the resulting Code Editor: dim f as FolderItem = ("test.sqlite") For that, make sure the App object is selected and add the Open Event Handler to it using the Insert > Event option. If database.Error then MsgBox "Error connecting to the database"Īs you can see, it is pretty much the same code we already use when creating SQLiteDatabase instances in our Desktop apps, linking to our SQLite database file and stablishing the connection so we can operate with the database engine from our app. Xojo Web projects offer two ways to handle the request received. This is the one that fires every time a client app (it may be a Web Browser, desktop or mobile app) connects to the URL associated with the IP address and port combination that is listening for incoming requests. If we were writing a Web App, then this would be the event we would use to attend, process and send the requested web pages, for example. However, for web services we need to add the HandleSpecialURLevent to our project. The main difference is that, in this case, we can use typical URL signatures when its about talk with web APIs, where the methods (i.e, the requested action by the clients or API consumers) is part of the URL itself. In addition, this is the event that will allow our Web apps to attend and process the callbacks from other external web services, as could be PayPal, for example.įor example, a valid URL that can be trapped and processed by HandleSpecialURL is: The unique consideration is that these URL need to include the word Special or API as part of their URL path. Where getCustimers is in this case one of our API methods.
0 Comments
Leave a Reply. |