Database connection

  1. 5 months ago

    I have been using Xojo since it was REALbasic 2 and have always struggled with databases. I wrote my last program a few years ago and recently decided to update it. I am using an unregistered copy of Xojo to see if it will work. It ran perfectly in an application built by Real Studio 2015.

    Are there any limits to using databases without a licensed copy? I believe there was years ago. Here's my story. I could not open a database in code as before. I found that I could import the database as a property of the project and it connected without code when I ran the application.

    However, when I open a second window there is nothing I can do to make it connect to the database. When I check if the database is connected I get an odd error "not an error" and it still doesn't connect.

    It is a SQLite database. Window 1 passed information to window 2 where it can be edited and saved back to the database. Is there any reason why this should not work other than bugs in the code?

  2. Emile S

    Dec 26 Europe (France, Strasbourg)

    @James D Window 1 passed information to window 2

    How do you do that (with code) ?
    If you use Property(ies), I hope you set them in a Module.

    Also:
    if I understand correctly, WIndow 1 is displaying the DataBase Contents and
    Window 2 is there to add / edit its contents…

  3. You understand correctly. The data works. It just will not connect to the database. Just wanted to verify that there are no limitations in Xojo or something rlae I should look for.

  4. Emile S

    Dec 26 Europe (France, Strasbourg)

    @Emile S If you use Property(ies), I hope you set them in a Module.

    If you use Property(ies), in Window 1, you will get troubles… in Window 2.

    @James D there are no limitations in Xojo or something rlae I should look for.

    Only what I wrote above and this is not limited to SQLite…

    A Global Property have to be in App or in a Module, else, you will get problems at run time: the property can be empty when running and filled when you check in the debugger.

    Now without more explanation on how you use SQLite in both windows, it is hard to tell anything (check SQLite cases in Feedback ? There are > 350 entries in Feedback).

    @James D Real Studio 2015

    There is no such neast (IMHO): Xojo replaced Real Studio in 2013: the last Real Studiowas released in 2012 (still IMHO).

  5. All I can say is mine opens up as Real Studio 2015. I think I may have discovered the problem. I will try it when I get home

  6. After dusting off the memory it was probably 2012. The 2015 was Xojo that I rarely used because I never updated my license.

  7. Tim S

    Dec 28 Canterbury, UK

    If you are opening the db in Window1 and passing some data to Window2 for editing, are you then passing it back to window1 to save back in the db? Why d'ye need to open the db in window2? How about showing the window2 code where you connect to the db and telling us what the error code is you get.

  8. Bob K

    Dec 28 Pre-Release Testers, Xojo Pro Kansas City

    If this is a desktop application you should be able to create a single database connection and use it everywhere in the application. No need to 'pass' the connection around. Simply put it in a global location. Use a module or put as a property in the app object.

or Sign Up to reply!