this is my sample program on how to Insert, Update, and Delete Via your database: the
connection is Done through system DSN, before running this program first create a
simple DSN connection via control panel,if you have no idea on how to create a DSN
Connection just follow this Link How to create a System DSN of MS Access,follow the
steps that are stated there:in this sample program will include a simple Error handler,
at a simple calling method
for the INSERT Statement Code this will
look like this:
Conn.Execute "INSERT INTO Names (ID_Num,FName,MName,LName,C_N) " _
& " VALUES ('"& (txtID.Text) & "','"& (txtFN.Text) & "','"& (txtMN.Text) _
& "','"& (txtLN.Text) & "','" & (txtCn.Text) & "')"
'you must state your Database Table Field Name and for the Values is the control where did
you store the data to Insert on your Database so for example at the code above is ID_Num is
my database table field Name and the data that i want to put on its column is the data holds by
the txtID control or by default is Textbox Control
For the UPDATE Statement:
Conn.Execute "UPDATE Names SET FName='" & (txtFN.Text) & "',MName='" _
& (txtMN.Text) & "',LName='" & (txtLN.Text) & "',C_N='" & (txtCn.Text) & "'
WHERE ID_Num='" & (txtID.Text) & "'"
0 Comments













