English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How to store the file names inside a user specified folder in Access database using visual basic 6.0?

2006-06-19 23:52:16 · 2 answers · asked by Aswin Suriya 2 in Computers & Internet Programming & Design

2 answers

This is a pretty generic answer but it should point you in the right direction. This is using DAO for the database connection, you could also use ADO to do the same thing. You would use these by setting a reference to the MS DAO or MS Active X Data Objects libraries.

Private Sub UpdateUserInfo()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim sFileName As String


Set db = OpenDatabase("C:\database.mdb")
Set rs = db.OpenRecordset("Table")

sFileName = Dir("C:\UserFolder\*.*")

While sFileName <> ""
rs.AddNew
rs!FileName = sFileName
rs.Update

'Get next filename in directory
sFileName = Dir
Wend

rs.Close
db.Close

Set rs = Nothing
Set db = Nothing
End Sub

2006-06-30 16:58:00 · answer #1 · answered by inane 1 · 1 0

If the guidelines is hierarchal then you absolutely can use an straight forward XML record to save the guidelines. it really is quite no diverse that storing archives "disconnected" in a knowledge record in reality XML is semi-depending. obviously, a person can frequently open an XML record and edit or seem on the guidelines there. Are you utilising previous college VB or VB.internet?

2016-10-14 08:10:50 · answer #2 · answered by ? 4 · 0 0

fedest.com, questions and answers