Connessione aMS SQL Server con utente di dominio

Buongiorno a tutti.
Esordisco dicendo che sono nuovo di Xojo, per cui sono ababstanza ignorante in materia.
Sto testando la connessione a un database Microsoft SQL Server (Express) presente su un server di rete partendo da una macchina Windows. Ho creato un metodo che tents di collegarsi al database e restituisce un booleano vero in caso di connessione avvenuta o falso se la connessione fallisce. Queste sono le istruzioni per la connessione:

var db as new MSSQLServerDatabase db.Host = "bossrv10\\SQLRoda" db.DatabaseName = "RisorseUmane" db.UserName = "dominio\\utente" db.Password = "password" db.Port = 1433 try db.Connect Return True catch Return false end try

Funziona tutto correttamente se utilizzo un utente di SQL Server, ma non risco a connettermi con un utente di Windows creato in Active Directory.
Cercando su Internet trovo vari siti dove appunto indicano di utilizzare dominio\utente per la connessione, ma ottengo sempre l’errore 18456 - Login failed for user ‘dominio\utente’.
Qualcuno sa dirmi perch accade questo?


To login to the database as the current Windows user, leave db.UserName and db.Password blank. Of course, the Windows user must have an account on the database.

Se avete bisogno di più, potete sempre controllare MBS Xojo SQL Plugin.

Fa anche Microsoft SQL Server.

Quando ci si connette ad un’istanza si passa ad esempio “MyServer\SQLEXPRESS@pub” come stringa di connessione.

Ok. Funziona perfettamente!
Ho visto il plugin di MBS ma, come gi detto, sono un neofita di Xojo e provengo da Delphi. Esiste un tutorial chiaro su come implementare una gestione di database con questo ambiente di sviluppo? Indendo dire gestione delle varie tabelle, relazioni e via dicendo?

La documentazione italiana qui: Italiano


Do you mean managing the database structure and other administration from within Xojo? Xojo doesn’t have any of that capability, other than issuing SQL statements in your code. You need to use other tools to manage the database (usually Management Studio for SQL Server). If you want a management tool that can connect to most any database, I recommend DBeaver.

No, jay I don’t mean that. My intension is to realize an application that uses an exixting database in order to implement a complete system for tracking all the trucks, cars, and so on of the firm I work for.
So I need to manage, for example, the table of insurance, the one of vehicle, the one of vehicles users and so on. The application must read, write, add, remove record in these tables; so: a database management

Xojo doesn’t automatically create any of the “database interaction” components (or CRUD) for you. You have to develop them all yourself. Most of us begin by creating classes to encapsulate the various db tables. ARGen is a commercial product that not only does this, but also creates a basic application framework for you.

Many thanks for the suggestion I certainly test it, but what if I would like to implement a CRUD by myself? There is a clear tutorial (maybe in PDF)?

I don’t know of any thorough tutorials for CRUD in Xojo, but there is this one for SQLite basics. Most all database operations are the same across the different database platforms in Xojo, so a lot of this tutorial would apply to SQL Server as well. Just skip past the parts pertaining to SQLite, to the section “Designing the UI for our Database App”. One thing not really covered in this tutorial is you could use a listbox to list all or a subset of records, then open the data entry form for a single record the user selects (either via a button or the double-click event on the listbox).

There’s also several example apps included with Xojo. From the New Project window, select Examples on the left side, then peruse the Database and Sample Applications folders. There’s also this video from Paul that may be useful.

Hope this helps.

Thanks for your suggestions Jay. Very helpfull. I’m trying to implement a class for creating what I talk about but, as I said, I’m coming from Delphi so I’m afraid I treat the problem as I will do in Delphi, so it will be a little disorienting for me!