mssql.New1
mssql.Open("Persist Security Info=false;Integrated Security=false;Server=" & server & ", " & port &"; initial catalog=" & database & "; user id="& login & "; password=" & pass)
If connected = True Then
mssql.ExecuteQuery("Select nickname From Employees Where status = 1")
Do While mssql.Data
mssql.Read("nickname")
Loop
End if
mssql.Close
mssql.Open(..like first part..)
mssql.ExecuteQuery("Select.....")
Dim execres as Boolean
execres = mssql.ExecuteNonQuery("Update Employees Set status = 0")
If execres = True Then
execres = mssql.Commit
if execres = False Then
Msgbox("Commit Failed.")
End If
End If
TransactionDispose - returns True or False
Dim connected As Boolean
connected = mssql.Open("Persist Security Info=false;Integrated Security=false;Server=" & server & ", " & port &"; initial catalog=" & database & "; user id="& login & "; password=" & pass)
I Get connected = True.
Dim result As Boolean
result = mssql.BeginTransaction
I also get result = True.
Dim execresult As Boolean
execresult = mssql.ExecuteQuery("Select nickname from Employees Where status = 1")
I always get execresult = False.
ExecuteReader requires the command to have a transaction when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized.
// Must assign both transaction object and connection
// to Command object for a pending local transaction
command.Connection = connection;
command.Transaction = transaction;
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?