Click to See Complete Forum and Search --> : opening dBase table at runtime
treyz3
Nov 5th, 1999, 10:57 PM
I need to open a dBase table at runtime, but the OpenDatabase() method reports that the database is a unrecognized format.
Is there some other method that I can use to open this table??
Thanks.
smalig
Nov 6th, 1999, 07:59 PM
Try it:
------------------
Dim db As Database
Dim tbl1 As Table
Dim dbName$, Connect$
Connect = "dBASE IV;" ' Specify database type
dbName = "D:\DBASEIV" ' Specify database directory
Set db = OpenDatabase(dbName, False, False, Connect)
Set tbl1 = db.OpenTable("Table1") ' Open table
------------------
smalig
smalig@hotmail.com
smalig.tripod.com (http://smalig.tripod.com)
treyz3
Nov 6th, 1999, 09:26 PM
Thanks, but that didn't quite work. Here's the code that worked for me:
-------------------------------------------
Dim PlayerDB As Database
Dim dbName$, Connect$
Set PlayerDB = OpenDatabase(dbName, False, False, Connect)
Set dtaPlayers.Recordset = PlayerDB.OpenRecordset("Select * from Players.dbf")
-------------------------------------------
Thanks.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.