Click to See Complete Forum and Search --> : VB
wilton
December 13th, 1999, 10:28 AM
I'm trying to write a program that opens up an access database and modifies the values in that db. I've successfully created the database and and filled a table with the fields that I need but I haven't been able to fill the db with the data(records) that I need. What I need to know is should I be using DAO for this? or can I do it using opencurrentdatabase etc??? Any help or direction would be appreciated. wilton@viser.net
Dr_Michael
December 18th, 1999, 06:39 AM
You can do it with both ways. Select one and I'll guide you how to do it...
Michael Vlastos
Automation Engineer
Company SouthGate Hellas SA
Development Department
Athens, Greece
wilton
December 18th, 1999, 03:46 PM
Thank you. But I figured it out. I made a really simple mistake. I forgot to set Dao as one of my libraries.
Dr_Michael
December 21st, 1999, 08:41 AM
;-)
Michael Vlastos
Automation Engineer
Company SouthGate Hellas SA
Development Department
Athens, Greece
a01078
December 22nd, 1999, 10:39 PM
I would use ADO instead of DAO. Something like this:
Dim rst as ADODB.Recordset
Dim con as ADODB.Connection
set con = new ADODB.Connection
con.ConnectionString = "DRIVER=(Microsoft Access Driver (*.mdb)); DBQ=databasename.mdb;DefaultDir=" & App.path & ";UID=admin..."
con.Open
rst.Open "select * from table", con
There really are any number of ways to use it; i.e. thru the Command obj, the Connection obj or even the Recordset obj. I believe the piece of code above should work.
good luck.
Lee Barnard
Atlanta, GA
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.