Text converted to Access MDB

zhaozj2021-02-17  44

Text File Type In many software, it is a bridge between the general application and the database. You can use Text Isam

Drivers and SQL to convert the Text file into an Access MDB database file, first create a Schema.ini for text files.

file. Then you can use the following code to implement the conversion:

DIM DB AS DATABASE, TBL AS TABLEDEF

SET DB = DBENGINE.CREATEDATABASE (app.path & "/mymdb.mdb", dblangGeneral, dbversion_0)

Set tbl = db.createtabledef ("temp")

TBL.Connect = "text; database = c: / vbpj / data"

Tbl.SourceTableName = "Customer # txt"

DB.TableDefs.Append TBL

Db.execute "SELECT TEMP. * INTO NEWTABLE from Temp"

db.tabledefs.delete TBL.NAME

Db.close

Set TBL = Nothing

SET DB = Nothing

转载请注明原文地址:https://www.9cbs.com/read-29557.html

New Post(0)