Example: /SQL/Sybase Connect

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/SQL/Sybase Connect


Required plugins for this example: MBS SQL Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /SQL/Sybase Connect

This example is the version from Thu, 4th Jul 2018.

Project "Sybase Connect.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open() dim con as new SQLConnectionMBS try // where is the library? // optionally pass paths to databases... #if false // targetWindows then con.SetFileOption(con.kOptionLibrarySybaseComn, GetFolderItem("libsybcomn.dll")) con.SetFileOption(con.kOptionLibrarySybaseCS, GetFolderItem("libsybcs.dll")) con.SetFileOption(con.kOptionLibrarySybaseCT, GetFolderItem("libsybct.dll")) con.SetFileOption(con.kOptionLibrarySybaseIntl, GetFolderItem("libsybintl.dll")) con.SetFileOption(con.kOptionLibrarySybaseTCL, GetFolderItem("libsybtcl.dll")) #endif // connect to database // in this example it is Sybase, // but can also be Firebird/InterBase, Informix, DB2, MySQL // SQLServer, SQLBase and ODBC // Read more here: http://www.sqlapi.com/ServerSpecific/Sybase.html // Please enter values for your server here: dim ConnectionString as string = "server@database" // One of the following formats: // "" or "@" - empty string or '@' character, connects to a default database on a default server. // <database name> or @ <database name>- connects to a database with the specified name on your default server. // <server name>@- connects to a default database on the specified server. // <server name>@<database name> - connects to a database with the specified name on the specified server. dim username as string = "xxx" dim password as string = "xxx" con.Connect(ConnectionString, username, password, SQLConnectionMBS.kSybaseClient) MsgBox "We are connected!" // Disconnect is optional // autodisconnect will occur in destructor if needed con.Disconnect msgbox "We are disconnected!" catch r as RuntimeException MsgBox r.message // SAConnection::Rollback() // can also throw an exception // (if a network error for example), // we will be ready try // on error rollback changes con.Rollback catch rr as runtimeexception MsgBox rr.message end try end try End EventHandler
End Class
Class Window1 Inherits Window
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project

The items on this page are in the following plugins: MBS SQL Plugin.


💬 Ask a question or report a problem