Im writing an application for use in conjunction with Word 8.0b. The
application will execute different SQL/DML statements on several
different tables. When I execute the following VB-code:
Set ws = CreateWorkspace(dbName, uid, passwd, dbUseODBC)
Set conn = ws.OpenConnection(name:=dbName, Connect:=strConn,
sqlStr = "DELETE FROM documents WHERE regno = 'P4461-9'"
conn.Execute sqlStr, dbExecDirect + dbFailOnError
I run into the VB error handler which tells me "Error 3001: Invalid
argument". Of course, no on-line help is avaliable for this error
section. I have looked at the Microsoft KB, where I can find an
explanation, but that explanation is irrelevant. It only says that this
error will occur if I mix the execute options in an inconsistent way. I
have tried to remove as well the "dbExecDirect" as the "dbFailOnError"
and even both, but with the same result.
I have tried the ODBC connection both as "sa" and the account-ID for my
application, but none of them works. The DB tables have the correct
permissions. Executing other DML statements from the application on
other, similar tables works fine. Running exactly the same SQL statement
on the enterprise manager SQL causes no problem either
As a matter of fact the above code is a fragment of a composite of SQL
transactions, wich starts with a delete on certain FK hits then followed
by inserts. Therefore I want to encapsulate the transactions between
"ws.BeginTrans"and "ws.CommitTrans" with "ws.Rollback" in the execption
block. But when I try THAT, I get thrown out from the MS Word session.
No DR Watson, no VB error message, just a stiff "Exit 0" without any
Can anyone help me?
Daniel Zagar/Information Systems Developer
Cresita Engineering AB
SE-250 24 Helsingborg, Sweden
Phone: +46-42-25 32 31 Fax: +46-42-25 32 99
< 1K Download