add recordset to end of table

C

Chris Nebinger

A form is a window to the data. I wouldn't worry about it
at all.

You need to connect to the database, either using DAO or
ADO. Add a reference to ADO, then use something like:


'Warning, Air Code incoming

Dim conn as ADODB.Connection
Dim rst as ADODB.Recordset
dim strPathToDatabase as string

strPathToDatabase
Set conn = new ADODB.Connection
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
& strPathToDatabase
Set rst = New ADODB.Recordset
rst.open "Select * from
[providers]",conn,adOpenDynamic ,adLockOptimistic

rst.AddNew
rst.fields("Field1") = strField1
rst.fields("Field2") = strField2
'.etc......
rst.Update
rst.close
conn.close
set rst = nothing
set conn = nothing



Chris Nebinger



-----Original Message-----
From vb6 Iâ?Tm trying to open an access db called
(C:\mystuff\Drawings2.mdb), then trying to add a new
record to the end of (Properties) form which is connected
to (Properties) table, and populate the fields with text
(strField1), (strField2), etc.
I feel that this should be pretty straightforward, but
after 2 days, Iâ?Tm no closer. Thanks in advance for any
help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top