MyTetra Share
Делитесь знаниями!
create an DAO Access file in Excel VBA
30.07.2019
00:02
Раздел: !Закладки - VBA - Access - DAO

create an DAO Access file in Excel VBA


I am unable to create a file using following commands, could anyone help me in this regard. The error it says is invalid argument.

I got office 2010.

My ref is :MS office 14.0 ACCESS DATABASE OBJECT LIBRARY

Sub DBcreate()

Dim DB As DAO.Database

Dim RS As DAO.Recordset

Set DB = DAO.Workspaces(0).CreateDatabase("D:\tblImport11.accdb", DB_LANG_GENERAL)

DB.Close

'Set RS = Nothing

Set DB = Nothing

End Sub

i also tried:

Set DB = DBEngine.CreateDatabase("D:\tblImport11.accdb", DB_LANG_GENERAL)

This also gives same error



The DB_LANG_GENERAL is the wrong parameter. Use:

Set DB = DBEngine.CreateDatabase("D:\tblImport11.accdb", dbLangGeneral)


Так же в этом разделе:
 
MyTetra Share v.0.52
Яндекс индекс цитирования