
help vb & access2k is driving me nuts
Here is some code that shows how to open an access d-base and create a
recordset. To put values into a field you need to use something like:
me!txtCustName.value = rst.fields("CustomerName")
Here is some sample code
Dim conn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim CustInfo As String
'Create connection to the database
Set conn = New ADODB.Connection
With conn
.Provider = "Microsoft.Jet.oledb.4.0"
.ConnectionString = "G:\cdbm190\nwind.mdb"
.Open
End With
Set rst = New ADODB.Recordset
rst.Open "Customers", conn, adOpenDynamic, adLockOptimistic
With rst
Do Until .EOF
CustInfo = rst!CompanyName & ", " & rst!ContactName
MsgBox (CustInfo)
rst.MoveNext
Loop
End With
rst.Close
Set rst = Nothing
Set Connection = Nothing
Quote:
-----Original Message-----
i have been spending days trying to write a simple code to front end
an access2000 mdb
I m far from a programer- does anyone have any simple code i can have
that just simply opens my access mdb and lets me add,edit& find?
printing found recordset would be nice but i can struggle through that
any help is appreciated
thanks
.