Database Input methods

penfold1992

Registered User.
Local time
Today, 08:50
Joined
Nov 22, 2012
Messages
169
Ok, heres a bit of a guilty secret...

I've been programming databases for over half a year now but im still not quite sure of something...

I need to create a form to input records (or modify records) however im unaware of the methods that could be used to actually put the data into the tables...

my current method is using:

Code:
Dim dbs as DAO.Database
Set dbs As CurrentDB
Dim InsertSQL As String
 
InsertSQL = "INSERT INTO [Table] (Columns) VALUES (Values)"
dbs.Execute InsertSQL

I am not sure if this is the most effecient or best or if it has issues that other methods or ways to use but doing this seems to do the trick.
Ive seen ADODB around but im not too sure what it is or whether there is any use in using it over DAO
 
If you create a form and make the Record Source a table or a query linking several tables. Then bind each field on the form to a field from your record source then the data is automatically inserted into (or modified) the table(s). You don't need SQL at all if you do it this way. The simplest way of doing it.
 
Do not think there is any issue with that method.

I normally use a form (bound to the table) in Data Entry mode. No fuss. The only time I do not use a Data Entry form is when the data needs validation & customisation in some way. On those occasions I generally use an unbound form to gather the data, then either use an Append Query (so DoCmd.OpenQuery "UpdateQueryName") or add via SQL like you.
 
Do not think there is any issue with that method.

I normally use a form (bound to the table) in Data Entry mode. No fuss. The only time I do not use a Data Entry form is when the data needs validation & customisation in some way. On those occasions I generally use an unbound form to gather the data, then either use an Append Query (so DoCmd.OpenQuery "UpdateQueryName") or add via SQL like you.

yeah, im using data validation... i want to keep the back end of the database well away from the users... so im going to lock that up so they cant tamper with it. Then i would use an unbound form.
 

Users who are viewing this thread

Back
Top Bottom