View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ronald R. Dodge, Jr.[_2_] Ronald R. Dodge, Jr.[_2_] is offline
external usenet poster
 
Posts: 134
Default Problem with .Update

Look through the documentations dealing with the SmartWare Driver and see
what cursor key types are allowed against the engine using ADO. For
Example:

When using a Jet Engine (What Access uses), the only way to get a dynamic
connection with it is to use the dbOpenDynamic for the type and the
dbSeeChanges for the options using DAO 3.60. However, for when using ADO
against the Jet Engine, can't use adOpenDynamic or adOpenKeyset, thus forces
one to think about using the disconnected FE/BE model similar to what is
trained with ADO.NET coding.

--
Thanks,

Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
"Mike H." wrote in message
...
On the below code, I get an error on the line .Update. The message says

"[SmartWare ODBC Driver] Parameter can not be used in select list."
Anyone
have any idea what to do to write a new record to this odbc-compliant
table?


Dim cn As ADODB.Connection, rs As ADODB.Recordset
Set cn = New ADODB.Connection
cn.Open "DRIVER=SmartWare Driver
(*.db);SERVER=Smart4;DBTYPE=Smart4;DBQ=
" & DataSource
Set rs = New ADODB.Recordset
rs.Open "pr_ckreg", cn, adOpenKeyset, adLockOptimistic, adCmdTable
With rs
.AddNew ' create a new record
.Fields("gross_pay1") = DataArray(X, 18)
.Update
End With
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing