Hi Gurus,
according to this link below is not possible to open Access from VBA using method CreateObject ("Access.Application")
https://support.microsoft.com/en-us/kb/295179
How can i open Access database using VBA from EXcel and connecting to Access RunTime?
I have to have connection to access to do:
1. add row to existing table
2. refresh existing query.
Maybe Did you have also a problem connected to mine?
Please help,
Warm Regards,
Jacek Antek
according to this link below is not possible to open Access from VBA using method CreateObject ("Access.Application")
https://support.microsoft.com/en-us/kb/295179
How can i open Access database using VBA from EXcel and connecting to Access RunTime?
I have to have connection to access to do:
1. add row to existing table
2. refresh existing query.
Code:
Set rs = New ADODB.Recordset
rs.Open "tb_wpisy", Connectstr, adOpenKeyset, adLockOptimistic, adCmdTable
With rs
.AddNew
![NumerSpółki] = TicketNumber
![User] = Login
.Update
.Save
.Close
End With
'
'AccessApp.Visible = True
AccessApp.OpenCurrentDatabase (Lokalizacja_Pliku)
AccessApp.docmd.openquery "qry_tb_wpisy", 0, 1
AccessApp.CurrentDatabase.Execute ("UPDATE qry_tb_wpisy"), 0
Set rsQuery = New ADODB.Recordset
rsQuery.Open "qry_tb_wpisy", Connectstr, True, True
With rsQuery
.Update
.Save
' NumerZgłoszenia = ![NumerZgłoszenia]
End With
Set rs = Nothing
Set rsQuery = Nothing
Maybe Did you have also a problem connected to mine?
Please help,
Warm Regards,
Jacek Antek