## Microsoft Access Database

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

trags3
Posts: 394
Joined: Wed Apr 09, 2014 1:58 am
Location: Las Vegas, NV

### Microsoft Access Database

Correct me if I'm wrong but I don't believe there is a way to directly access the Microsoft Access database with LC.

Tom

cpuandnet
Posts: 25
Joined: Thu Jan 17, 2019 6:43 am

### Re: Microsoft Access Database

Hi Tom,

No, not directly. You need to use an ODBC driver via DSN or use a DSNless string. I use it all the time but prefer the DSNless string option because one does not have to setup the DSN on each machine.

Tim

trags3
Posts: 394
Joined: Wed Apr 09, 2014 1:58 am
Location: Las Vegas, NV

### Re: Microsoft Access Database

Hi Tim,
Can you show me an example?

cpuandnet
Posts: 25
Joined: Thu Jan 17, 2019 6:43 am

### Re: Microsoft Access Database

Yes, of course. This is way oversimplified but you'll get the idea. Assuming your developing on and for Windows...

Code: Select all

local tDatasource
put "Driver={Microsoft Access Driver (*.mdb, *.accdb)};" & \
"DBQ=c:\your\path\to\your\database.accdb;" into tDatasource

local tDatabaseID