Hi angelfire,
To input data to database, in this case is access, you can use SQL Query or recordset.
example:
after users submit the form,
- Using SQL Query.
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("Inventory_Control2.mdb")
SQL = "insert into [TABLENAME] ([FIELD1], [FIELD2], ....) values ([VALUE1], [VALUE2], ....)"
adoCon.execute SQL
-Using Recordset
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("Inventory_Control2.mdb")
Set rsInventory_Control2 = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT tblCustomers.CustomerID, tblCustomers.EMAilAddress FROM tblCustomers;"
rsInventory_Control2.Open strSQL, adoCon, 2, 3
rsInventory_Control2.AddNew
rsInventory_Control2("FIELD1") = VALUE1
rsInventory_Control2("FIELD2") = VALUE2
.
.
.
.
.
rsInventory_Control2.Update
rsInventory_Control2.Close
Set rsInventory_Control2 = Nothing
Set adoCon = Nothing
Regards,
Sherief C. Mursyidi
|