Hi Vlad,
this is not working.
Code:
Sub AuditChanges(IDField As String, UserAction As String)
On Error GoTo AuditChanges_Err
Dim cnn As Object
Dim Scnn As String
Dim rst As Object
Dim ctl As Control
Dim datTimeCheck As Date
Dim strUserID As String
Set cnn = CreateObject("ADODB.Connection")
Scnn = CurrentDb.TableDefs("t_audittrail").Connect
cnn.ConnectionString = Scnn
Set rst = CreateObject("ADODB.recordset")
rst.Open "SELECT * FROM t_audittrail", cnn, adOpenDynamic, adLockOptimistic
I have error while opening the recordset:
Error 3709: The connection cannot be used to perform this operation...
Can you help with this Vlad?
pbaldy you are right!
i can use:
Code:
Set rst = CreateObject("ADODB.recordset")
Set rst = CurrentDb.OpenRecordset("t_audittrail")
and this is working.
best,
Jacek