GXSQLSRV class¶
-
class
GXSQLSRV
(handle=0)¶ GXSQLSRV class.
SQL Server and MSDE utility functions
-
classmethod
attach_mdf
(server, user, password, db, mdf_file_name, ldf_file_name)¶ Attaches an MDF SQL server file to a server.
Parameters: - server (str) – SQL server to use
- user (str) – User name (if blank assume NT Integrated Security)
- password (str) – Password
- db (str) –
GXDB
name - mdf_file_name (str) – MDF name
- ldf_file_name (str) – LDF name (if blank, tries single db attach)
Returns: 0 - OK 1 -
GXDB
Operation Canceled Terminates on ErrorReturn type: int
New in version 5.1.8.
License: Geosoft End-User License
Note: The file’s path need to be visible as local files on the server. Network drives and substitutes may not work.
-
classmethod
detach_db
(server, user, password, db)¶ Detaches a SQL Server database from a server.
Parameters: - server (str) – SQL server to use
- user (str) – User name (if blank assume NT Integrated Security)
- password (str) – Password
- db (str) –
GXDB
name
Returns: 0 - OK 1 -
GXDB
Operation CanceledReturn type: int
New in version 5.1.8.
License: Geosoft End-User License
-
classmethod
get_database_languages_lst
(lst, server, user, password, win_auth)¶ Get a list of the languages into
GXLST
Parameters: - server (str) – SQL server to use
- user (str) – User name
- password (str) – Password
- win_auth (int) – 0 - SQL authentication, 1 - NT integrated securty
Returns: Number of languages
Return type: int
New in version 5.1.8.
License: Geosoft End-User License
-
classmethod
get_databases_lst
(lst, server, user, password, win_auth)¶ Get a list of the database into
GXLST
Parameters: - server (str) – SQL server to use
- user (str) – User name
- password (str) – Password
- win_auth (int) – 0 - SQL authentication, 1 - NT integrated securty
Returns: Number of database
Return type: int
New in version 5.1.8.
License: Geosoft End-User License
-
classmethod
get_login_gui
(server, user, password, mode, win_auth)¶ Get/Test login information to SQL Server
Parameters: - server (str) – SQL server to use
- user (str_ref) – User name (default & returned)
- password (str_ref) – Password (default & returned)
- mode (int) – MFCSQL_DRIVER constants
- win_auth (int_ref) – Windows Authentication (default & returned)
New in version 5.1.8.
License: Geosoft End-User License
-
classmethod
get_servers_lst
(lst)¶ Get a list of the visible servers into
GXLST
Returns: Number of servers Return type: int New in version 5.1.8.
License: Geosoft End-User License
-
is_null
()¶ Check if this is a null (undefined) instance
Returns: True if this is a null (undefined) instance, False otherwise. Return type: bool
-
classmethod
MFCSQL_DRIVER constants¶
SQL Server Driver
-
MFCSQL_DRIVER_NOPROMPT
¶ No dialog box, Error if authentication parameters are wrong
-
gxapi.
MFCSQL_DRIVER_NOPROMPT
= 0
-
-
MFCSQL_DRIVER_COMPLETE
¶ Only shows dialog box if authentication parameters are wrong
-
gxapi.
MFCSQL_DRIVER_COMPLETE
= 1
-
-
MFCSQL_DRIVER_PROMPT
¶ Always show dialog box, with option to change parameter
-
gxapi.
MFCSQL_DRIVER_PROMPT
= 2
-
-
MFCSQL_DRIVER_COMPLETE_REQUIRED
¶ Same as
MFCSQL_DRIVER_COMPLETE
except only missing parameters are editable-
gxapi.
MFCSQL_DRIVER_COMPLETE_REQUIRED
= 3
-