I want to load a single dbase file into a listbox. Any suggestions would be great! Thanks.
Printable View
I want to load a single dbase file into a listbox. Any suggestions would be great! Thanks.
Create a recordset for the field(s) that you need and enter it to the listbox.
List1.AddItem rs!Field1 & " " & rs!Field2
If you need a connection string for dbase, let me know
Iouri Boutchkine
[email protected]
Thanks for the tip. I know how to create a connection for a database that stays in one place. But my problem is that I want to allow the user to specify where the .dbf file is stored.
For example, the user is asked to specify where the .dbf file is stored. Once they specify the location the .dbf files needs to be read into the listbox. I guess my question is how do I create a connection that is dynamic? My experience has only been with connecting to a database that stays in one place.
On a button click bring an InputBox where user can enter the database path (or you can use Dialog Box). Assign path to the variable (DBFPATH) and then create the connection string
sConn = "Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=" & DBFPATH & ";"
Here we go. We eill connect to the chosen location.
Iouri Boutchkine
[email protected]