All
According http://support.microsoft.com/kb/281998/en-us I would be able to create an updateable form based upon an ADODB-recordset.
However, I did a copy paste the code and changed some parameters. I do get the form with the expected records, but I cannot change them nor add records. The account I use does have write-access, the form's update-property is true, the table got a primary key,...
The Microsoft article uses the "User ID" and "Password"-values, but I need to use "Integrated Security".
I use MS Access 2007 as interface, the database is stored on MS SQL Server.
I am able to do batch-updates via next code and I tried to assign me.recordset=rscap (but this results in an error message)
According http://support.microsoft.com/kb/281998/en-us I would be able to create an updateable form based upon an ADODB-recordset.
However, I did a copy paste the code and changed some parameters. I do get the form with the expected records, but I cannot change them nor add records. The account I use does have write-access, the form's update-property is true, the table got a primary key,...
The Microsoft article uses the "User ID" and "Password"-values, but I need to use "Integrated Security".
I use MS Access 2007 as interface, the database is stored on MS SQL Server.
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Access.OLEDB.10.0"
.Properties("Data Provider").value = "SQLOLEDB"
.Properties("Data Source").value = strSQLServer
.Properties("Initial Catalog").value = strSQLDatabase
.Properties("Integrated Security").value = "SSPI"
.Open
End With
strSQL = "select * from dbo.tblReportType"
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = cn
.Source = strSQL
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.Open
End With
Set Me.Recordset = rs
Set rs = Nothing
Set cn = Nothing
End If
I am able to do batch-updates via next code and I tried to assign me.recordset=rscap (but this results in an error message)
Set cnCap = New ADODB.Connection
With cnCap
.Provider = "SQLOLEDB"
.Properties("Data Source").value = strSQLServer
.Properties("Initial Catalog").value = strSQLDatabase
.Properties("Integrated Security").value = "SSPI"
.Open
End With
strSQL = "select * from dbo.tblReportType"
Set rsCap = New ADODB.Recordset
rsCap.Open strSQL, cnCap, adOpenDynamic, adLockOptimistic
rsCap.MoveFirst
rsCap.Edit
rsCap!Value = "newvalue"
rsCap.Update