Thread: open database
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bill Manville Bill Manville is offline
external usenet poster
 
Posts: 473
Default open database

Solo_razor wrote:
I have
defined some variables and i want to put those in a table.
The database is called : proto
The table is called: structure
items a dir_structure, lidnr, filesave

I am using msaccess. Does anybody has some code to put this into a
record of this table


Tools / Reference / Microsoft DAO Library 3.6 (or as appropriate)

Sub AddRecord()
Dim DB As Database
Dim RS As RecordSet
Set DB = OpenDatabase("C:\MyDir\Proto.mdb")
Set RS = DB.OpenRecordset("Structure", dbOpenDynaset)
RS.AddNew
RS("Dir_Structure") = "A"
RS("lidnr") = 2
RS("filesave") = "C"
RS.Update
RS.Close
DB.Close
End Sub

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup