I have a connection to database with requred rights (insert,
update,select,delete)
I'm trying to insert the same sentence that goes fine from any other
sql-environment with exacly same uid&pwd (plus33w for example)
-code->
Global variables:
Dim cnn As Connection
Dim wrkspace As Workspace
Dim datab As Database
'Create ODBCDirect workspace
Set wrkspace = DBEngine.CreateWorkspace("myWorkSpace", "reports",
"", dbUseODBC)
'Open database connection
Set cnn = wrkspace.OpenConnection("my_conn", dbDriverNoPrompt,
False, "ODBC;DSN=x;UID=y;PWD=z;")
'so here it IS read/write
<clip>
cnn.Execute str, dbRunAsync 'or
cnn.Execute str, dbExecDirect '->3146 error
either of those Execute's won't go through, I noticed that in the
examples they have used database.execute (dbsNorthwind.Execute
strSQLRestore, dbFailOnError)
if I use the following
Set datab = cnn.Database
datab.Execute str, dbExecDirect '-> 3001 error
datab.Execute (str) '-> 3146 error
datab.Execute str '->3146 error
datab.Execute (str,dbExecDirect) ' -> syntax error, = expected
in the other hand the select sentence is working through
strQ="select * from tableA"
* = ThisWorkbook.ExecQuery(strQ, recset)
I tried to found out the 3146 code , but didn't manage to find it from
any help file (it tried Jet error messages reference but didn't find it)
Any Ideas ??
BR
-Jouko