FIX: Invalid Argument Err on Execute Method w/ SQL Passthrough
ID: Q103976
|
The information in this article applies to:
-
Microsoft Visual Basic Professional Edition for Windows, version 3.0
SYMPTOMS
When you open a database using ODBC and use the Execute method of the
Database object or property with the SQL passthrough option (value 64)
specified, the error "Invalid argument" (number 3001) incorrectly
occurs.
WORKAROUND
Here are two possible workarounds. Use either one.
- Use the ExecuteSQL. Its default is DB_SQLPASSTHROUGH:
i = db.ExecuteSQL("action statement")
- Use CreateDynaset or CreateSnapshot with the SQL passthrough option to
execute an SQL action statement. Then close the resulting recordset
object immediately. Here's an example:
Dim ds As Dynaset
Set ds = db.CreateDynaset("action statement", SQL_PASSTHROUGH)
ds.Close
If you are using the data control, specify datacontrol.Database as the
database variable as in this example:
' Enter the following two lines as one, single line:
Set ds = Data1.Database.CreateDynaset("action statement",
SQL_PASSTHROUGH)
STATUS
Microsoft has confirmed this to be a bug in the products listed above.
This problem was fixed in the Compatibility Layer (COMLYR.EXE) update.
MORE INFORMATION
Steps to Reproduce Problem
The following program results in the incorrect "Invalid argument" error.
Const DB_SQLPASSTHROUGH = &H40
Dim db As Database
Set db = OpenDatabase("", False, False, "ODBC")
db.Execute "action statement", DB_SQLPASSTHROUGH
Additional query words:
3.00 buglist3.00 fixlist3.00
Keywords :
Version :
Platform :
Issue type :