MSSQLDatabase¶
Description¶
The MSSQLDatabase object can be used to connect to a Microsoft SQL Server using ODBC.
› Inherits: | NetworkDatabase |
---|
Properties¶
mars¶
This property holds whether to enable Multiple Active Result Sets (MARS) when connecting to the server.
› Type: | Boolean |
---|---|
› Default: | false |
› Signal: | marsChanged() |
› Attributes: | Writable, Optional |
tdsVersion¶
This property holds the TDS protocol version to use for connecting to the server. See Choosing a TDS protocol version for details.
› Type: | String |
---|---|
› Signal: | tdsVersionChanged() |
› Attributes: | Writable, Optional |
Example¶
import InCore.Foundation 2.5
import InCore.Database 2.5
Application {
version: "0.8.15"
MSSQLDatabase {
id: mssqlDB
user: "yourUser"
password: "y0urUserP@ssword"
server: "mssql.yourcompany.com"
port: 1433
sqlQueries: [
DatabaseSqlQuery {
id: updateVersionQuery
forwardOnly: true
query: ("EXEC [updateVersion]
@Version = %1")
.arg( version )
onErrorChanged: console.log( errorString )
}
]
onCompleted: updateVersionQuery.execute()
}
}