|
|
|
Каким образом я могу воспользоваться транзакциями в Access?
|
|||
|---|---|---|---|
|
#18+
А то в help есть BEGIN TRANSACTION и т.д., но каким образом и в каком контексте я могу их вызывать не описано. Основоное смоги ли я воспользоваться данным инструментом использую внешнее подключение к БД(программка клиент написана на Delphi)? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.08.2003, 10:01 |
|
||
|
Каким образом я могу воспользоваться транзакциями в Access?
|
|||
|---|---|---|---|
|
#18+
А чем данные таскаешь: ADO or DAO? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.08.2003, 10:11 |
|
||
|
Каким образом я могу воспользоваться транзакциями в Access?
|
|||
|---|---|---|---|
|
#18+
... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.08.2003, 10:19 |
|
||
|
Каким образом я могу воспользоваться транзакциями в Access?
|
|||
|---|---|---|---|
|
#18+
оттуда: BeginTrans, CommitTrans, and RollbackTrans Methods Example (VB) This example changes the book type of all psychology books in the Titles table of the database. After the BeginTrans method starts a transaction that isolates all the changes made to the Titles table, the CommitTrans method saves the changes. You can use the RollbackTrans method to undo changes that you saved using the Update method. Public Sub BeginTransX() Dim cnn1 As ADODB.Connection Dim rstTitles As ADODB.Recordset Dim strCnn As String Dim strTitle As String Dim strMessage As String ' Open connection. strCnn = "Provider=sqloledb;" & _ "Data Source=srv;Initial Catalog=Pubs;User Id=sa;Password=; " Set cnn1 = New ADODB.Connection cnn1.Open strCnn ' Open Titles table. Set rstTitles = New ADODB.Recordset rstTitles.CursorType = adOpenDynamic rstTitles.LockType = adLockPessimistic rstTitles.Open "titles", cnn1, , , adCmdTable rstTitles.MoveFirst cnn1.BeginTrans ' Loop through recordset and ask user if she wants ' to change the type for a specified title. Do Until rstTitles.EOF If Trim(rstTitles!Type) = "psychology" Then strTitle = rstTitles!Title strMessage = "Title: " & strTitle & vbCr & _ "Change type to self help?" ' Change the title for the specified ' employee. If MsgBox(strMessage, vbYesNo) = vbYes Then rstTitles!Type = "self_help" rstTitles.Update End If End If rstTitles.MoveNext Loop ' Ask if the user wants to commit to all the ' changes made above. If MsgBox("Save all changes?", vbYesNo) = vbYes Then cnn1.CommitTrans Else cnn1.RollbackTrans End If ' Print current data in recordset. rstTitles.Requery rstTitles.MoveFirst Do While Not rstTitles.EOF Debug.Print rstTitles!Title & " - " & rstTitles!Type rstTitles.MoveNext Loop ' Restore original data because this ' is a demonstration. rstTitles.MoveFirst Do Until rstTitles.EOF If Trim(rstTitles!Type) = "self_help" Then rstTitles!Type = "psychology" rstTitles.Update End If rstTitles.MoveNext Loop rstTitles.Close cnn1.Close End Sub ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.08.2003, 10:45 |
|
||
|
Каким образом я могу воспользоваться транзакциями в Access?
|
|||
|---|---|---|---|
|
#18+
А я через DAO. Но тоже хотел бы услыщать (увидеть) совет, как пользоваться транзакциями. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.08.2003, 10:46 |
|
||
|
Каким образом я могу воспользоваться транзакциями в Access?
|
|||
|---|---|---|---|
|
#18+
а слабо набрать в справке Transaction? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.08.2003, 10:51 |
|
||
|
|

start [/forum/topic.php?fid=45&msg=32239889&tid=1679855]: |
0ms |
get settings: |
8ms |
get forum list: |
20ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
67ms |
get topic data: |
10ms |
get forum data: |
3ms |
get page messages: |
43ms |
get tp. blocked users: |
1ms |
| others: | 206ms |
| total: | 364ms |

| 0 / 0 |
