Error 3001: Invalid argument

Error 3001: Invalid argument

Post by Daniel Zaga » Sat, 06 Feb 1999 04:00:00



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,
Options:=dbDriverNoPrompt)
  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
warning.

Can anyone help me?
________________________________________________________________________
Daniel Zagar/Information Systems Developer
Cresita Engineering AB
Box 22226
SE-250 24  Helsingborg, Sweden
Phone: +46-42-25 32 31  Fax: +46-42-25 32 99    

  dza.vcf
< 1K Download
 
 
 

1. Error 3001 - Invalid argument

Hi. I have a visual basic program that accesses a Microsoft
Access database. I had it working fine with Access 97 and DAO
3.5. I upgraded the database to Access 2000 and I changed my
program to use DAO 3.6 to access it. I thought it was working
fine, but I just noticed that one of my update queries isn't
working correctly. This query has one particular parameter of
type memo that is used to update a corresponding field that is
also of type memo. For some reason, if I set the value of this
parameter to a string with with any more than two characters, I
get Error 3001 - Invalid argument when I try to execute the
query. I get no error on the line where I actually set the value
of the parameter. The weird thing is that I have another memo
field in this table and a corresponding memo parameter in the
query that appear to be set up exactly the same way and I'm
having no problem with this pair. I have an append query with the
same parameters that appends records to this same table that is
giving me exactly the same problem. If I run these queries from
within Access rather than through my VB program, I'm able to
enter as many characters as I want into the troublesome parameter
and I get no error.

If anyone can suggest something I can try I'd really appreciate
it.  Thanks. - paul

--

2. ODBC SQL join problem

3. Please Help...Linking MBD's with code -- ERROR 3001 - Invalid Argument

4. Table Control in Java (JTable)

5. Error 3001, Invalid Argument, Not all the time!

6. How can I get this info?

7. ERROR 3001 - "Invalid Argument"

8. OpenRecordset 3001 Invalid Argument error

9. CompactDatabase gives "3001: Invalid Argument"

10. Error 3001 - Arguments are of the wrong type...

11. Filter on Recordset - RT Err '3001' Invalid Argument - Any Ideas?

12. Create local cube, got Error# 3001