this is a side application that is run when nobody is using the system. It works on a Point of Sale software. There is a database for sales and for detailed sales for each mmyy combo. So that would make, say 10 and 10--10 sales databases for 01/02 to 10/02, and 10 detailed sales dbs. Basically, in the item sales, there is a Bill_Number (int), and some sales info (total, taxes, time, etc). The detailed sales is a db with one entry for each item purchased for each sale. So there might be 3 entries for one sale, and 12 for another. Each of those has field Bill_Number that, obviously, has to correlate to the bill number of the general sale.
Because this client is using a number of different computer systems, it is necessary at some times to delete certain sales of a certain payment type for a certain server (etc) from this system. This is where this app comes in--it basically goes in the database and deletes those orders.
Because each database is labeled sales0302.dbf, sales0402.dbf, etc, i do not know what database I am using until the user types in the date they want to edit in the first form.
Because I use database access so much in this program, I actually made Database an Object. I have openDB(dbpath), closeDB(), runSqlQuery(qry), and closeRecordset() methods.
the basic code i use for opening a connection is:
dbDBF.Open "Driver={Microsoft dBASE Driver (*.dbf)};" & _
"DriverID=277;" & _
"Dbq=" & Directory
Set OpenDBConnection = dbDBF
and for running a query, basically:
Set dbRs = CreateObject("ADODB.Recordset")
dbRs.Open sql, dbDBF
Set RunSQLQuery = dbRs
and will run queries:
Set dbRsPmt = dbDBF.RunSQLQuery(sql_PMT)
i hope that helps... if you need any more info, just give me a hollar.
Thanks an awful lot,
noah