ActiveRecord is a set of classes that helps you abstract your database into Xojo classes. This gives you Table/Field autocomplete in the code editor and the compiler will flag datatype mismatches. We’ve used it many of our consulting projects and it saves us a ton of time. The update today lets it now work with CubeSQL server, PostgreSQL, MySQL, MS SQL Server, and SQLite (both the Real Studio and Xojo versions). Oracle was added but it’s totally unsupported by us.
ARGen (now at version 1.5) is a $19.95 utility that quickly creates the necessary data classes needed by ActiveRecord. It scans your db, lets you select the tables you want and it generates and xml project file with the project stuff in it. It now supports the same databases as ActiveRecord. It also adds the ability to add suffixes to your field names.
If you find database coding to be tedious, time consuming, and repetitive you might like ActiveRecord.
We released updates to both ActiveRecord and ARGen today. Mostly maintenance updates but some important ones if you are working with large databases. All of the record ID’s are now 64bit integer’s. The other big change was the addition of time field handling.
This update is free for ARGen users. They can update through the app or download from website.
ActiveRecord is free and available at its homepage.
[quote=210606:@ronaldo florendo]I just want to know if you have sample xojo that connect to Microsoft Sql and show record to list box?
Because most of examples here are using sql lite which is not my preference.[/quote]
The big difference is in the Data.OpenDB method. Instead of handing off a FolderItem to the SQLite database file, you’ll use the connection properties for MS SQL Server to create the db object, and then connect to it. You’ll also want to set BKS_ActiveRecordConfig.kIncludeMSSQLServer = True that code branch is used.
Just in case you didn’t know MS SQL Server only works on Windows.
Well, some of us like have a life. Asking questions on the weekend is the worst time to do it. And, frankly, you’re coming across as ‘needy’ rather than doing the work/research yourself. This community is very helpful but you have to put some work in.
Okay, so ActiveRecord is OPEN SOURCE. You should be able to drill down and figure out what it happening. MS SQL Server is probably the least used section of code in AR (because MS SQL Server is not big in the Xojo community) so it doesn’t surprise me that there’s something not working right.
You said yourself that you are new to Xojo. Frankly, I wouldn’t use ActiveRecord just yet. You need to learn the basics of using databases with Xojo FIRST, before diving off into the weeds in a big framework like AR. Everything in AR is using standard Xojo libraries.
If you take the time to learn Xojo you’ll be able to a) use the debugger to help identify where the real issue is; b) possibly be able to fix the problem yourself or at least be more helpful in asking questions.
I have not replied to your many private emails. I will be looking at MS SQL Server AFTER I get all my regular work done. It might take a few days so please be patient. Learn more about Xojo database programming in the meantime.
You might want to look at alternatives to ActiveRecord if you can’t wait:
Although im new to XOJO, I am able to adopt it immediately because its simplicity. I prioritized to buy AR I believed it will provides me great avenue to make things more simplified. Everything is done well.
Unfortunately, I got stuck with some error that I believe it belongs to someone (either database drivers or AR).
I tried using Postgress on same code, I failed.
I tried using MSSQL on same code, I failed
I tried using SQLite on same code, it works!
Now, im can ADD/EDIT/DELETE record using SQLite. But my target database system is atleast Postgress or MSsql. If you can provide me sample ARGEN for those database, it will be very much helpful!
[quote=210762:@ronaldo florendo]I tried using Postgress on same code, I failed.
I tried using MSSQL on same code, I failed
I tried using SQLite on same code, it works!
Now, im can ADD/EDIT/DELETE record using SQLite. But my target database system is atleast Postgress or MSsql. If you can provide me sample ARGEN for those database, it will be very much helpful![/quote]
¿No crees que te estás pasando al pedir un favor? Creo que @Bob Keeney ha sido muy explicito en su mensaje. Si no, usa Google Translate …
Una cosa es pedir ayuda, como todos lo hacemos y otra diferente es exigir. Bob se gana la vida como consultor…
Well, after spending some time looking at it over the weekend, it looks like ActiveRecord won’t work with MS SQL Server at this point in time. Not because of anything in ActiveRecord but because of the Xojo MS SQL Server plugin.
It seems that it doesn’t work, at all, with PreparedStatements and ActiveRecord is using them for Insert, Update, and Delete. Documented in April 2015 in <https://xojo.com/issue/39027>.
A while ago I was struggling with MS SQL Server and stored procedures. Could not get it working with the Xojo-native SQL Server plugin and gave up for the moment.
Think @Jim Cramer was right with his FB: “Looks like the MSSQL database driver needs some attention.” @Christian Schmitz does MBS provide a solution for it ?