I am developing an Excel VBA app that connects to an Access database to track login/logout activity.
Although my Excel VBA are decent, my Access VBA skills are almost non-existent as I've not spent much time in the Access Object model yet, so please forgive my ignorance.
In any case, I've built a basic Access 2007 database that currently sits on my D:/ drive. I am currently connecting to it without problems via a DAO connection, which I understand may be better suited for the older MDB database.
What I would like to do is:
1. Convert to the connection to the database to an ADO connection.
2. Move the database to my webhost (let's say it's www.abc123.com)
3. Make sure the connection is secure (I'm assuming this means a username and password, but perhaps more?)
4. Include a simple error trap that detects if the connection fails and displays a msgbox that says "Connection failed. Check your internet connection."
5. The goal is to make an automated login entry to the database, then drop the connection. Same with logout. It would be an automated entry that drops the connection once the record is saved.
Can anybody help me with that?
I am using the following DAO code which I found elsewhere on this forum:
Additionally, going forward, I understand that Access is slow and may not be the best database to use in a network setting, especially if a lot of users are accessing it. If that is true, are there better, low-cost alternatives? I'm assuming something like SQL would be expensive for an individual like myself? My webhost is currently a Windows platform, but I could move my domain to a Linux platform if necessary.
Although my Excel VBA are decent, my Access VBA skills are almost non-existent as I've not spent much time in the Access Object model yet, so please forgive my ignorance.
In any case, I've built a basic Access 2007 database that currently sits on my D:/ drive. I am currently connecting to it without problems via a DAO connection, which I understand may be better suited for the older MDB database.
What I would like to do is:
1. Convert to the connection to the database to an ADO connection.
2. Move the database to my webhost (let's say it's www.abc123.com)
3. Make sure the connection is secure (I'm assuming this means a username and password, but perhaps more?)
4. Include a simple error trap that detects if the connection fails and displays a msgbox that says "Connection failed. Check your internet connection."
5. The goal is to make an automated login entry to the database, then drop the connection. Same with logout. It would be an automated entry that drops the connection once the record is saved.
Can anybody help me with that?
I am using the following DAO code which I found elsewhere on this forum:
Code:
Sub Login_To_Access()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = OpenDatabase("D:\UserLogins.accdb")
Set rst = db.OpenRecordset("Login History") 'Add table name
With rst 'Use field names
.AddNew
.Fields("LogInDate") = Date
.Fields("LogInTime") = Time
Set rst = Nothing
Set db = Nothing
End With
End Sub
Additionally, going forward, I understand that Access is slow and may not be the best database to use in a network setting, especially if a lot of users are accessing it. If that is true, are there better, low-cost alternatives? I'm assuming something like SQL would be expensive for an individual like myself? My webhost is currently a Windows platform, but I could move my domain to a Linux platform if necessary.